Changeset 18248

Show
Ignore:
Timestamp:
08/26/08 14:57:19 (4 months ago)
Author:
gyuque
Message:

zoom maps in urban areas

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • lang/javascript/userscripts/gmll.user.js

    r18081 r18248  
    1818// 無視条件 
    1919var IGNORE_CASES = { 
     20        "://b.hatena.ne.jp/entry/": function(node) { 
     21                if (node.href && node.href.indexOf("/entry/rss/") >= 0) return false; 
     22                if (node.innerHTML && node.innerHTML.indexOf(" users") >= 0) return false; 
     23 
     24                node = node.parentNode; 
     25                for (var i = 0;i < 3;i++) { 
     26                        if (node.id == "entry-infosub") return false; 
     27                        node = node.parentNode; 
     28                } 
     29 
     30                return true; 
     31        }, 
     32 
    2033        "://b.hatena.ne.jp": function(node) { 
    2134                node = node.parentNode; 
     
    2942        } 
    3043} 
     44 
     45var URBAN_AREAS = [ 
     46        [35.6,139.43,35.8,140.1] // tokyo 
     47] 
    3148 
    3249// -------------------- 
     
    5774 
    5875                return {tile_index: {x:tx, y:ty}, offset: {x:ox, y:oy}, tile_zoom: (17-zoom)}; 
    59         } 
     76        }, 
     77 
     78        CBICON_BASEURL: 'http://maps.google.co.jp/intl/ja_jp/mapfiles/cb/man_arrow-', 
     79        CBICON_CX:   23, 
     80        CBICON_CY:   33, 
     81        CBICON_STEP: 22.5 
    6082} 
    6183 
     
    137159                var lng = LL[1] - 0; 
    138160 
     161                var urb = false; 
     162                for (var i in URBAN_AREAS) { 
     163                        var rc = URBAN_AREAS[i]; 
     164                        if (lat > rc[0] && lat < rc[2] && lng > rc[1] && lng < rc[3]) 
     165                        { 
     166                                urb = true; 
     167                                break; 
     168                        } 
     169                } 
     170 
     171                if (urb) 
     172                        zoom += 4; 
     173 
    139174                var xy = GoogleMapsCalc.LatLngToXY(lat * GoogleMapsCalc.DEG2RAD, lng * GoogleMapsCalc.DEG2RAD); 
    140175                var tile = GoogleMapsCalc.calcTileData(xy[0], xy[1], zoom);