diff options
author | Dave Whiteland <dave@mysociety.org> | 2012-05-29 15:57:41 +0100 |
---|---|---|
committer | Dave Whiteland <dave@mysociety.org> | 2012-05-29 15:57:41 +0100 |
commit | 67da8efc720d2d0bd22bd9fe8655b7e983b35bb4 (patch) | |
tree | 38b8570647124df06c637d4b923f6010211ef328 /web/js/map-bing-ol.js | |
parent | 40b3a51d33caefa8f5fb97ce9be18ef936c7e260 (diff) | |
parent | 131ff6e9bf3626d6a8fff6ae54669d250148a63a (diff) |
Merge remote branch 'origin/master' into fmb-read-only
Conflicts:
bin/send-reports
perllib/FixMyStreet/Cobrand/Default.pm
perllib/FixMyStreet/Cobrand/FixMyStreet.pm
templates/web/fixmystreet/alert/index.html
templates/web/fixmystreet/around/display_location.html
web/cobrands/fixmystreet/_layout.scss
web/js/map-OpenLayers.js
Diffstat (limited to 'web/js/map-bing-ol.js')
-rw-r--r-- | web/js/map-bing-ol.js | 25 |
1 files changed, 14 insertions, 11 deletions
diff --git a/web/js/map-bing-ol.js b/web/js/map-bing-ol.js index 89b274b18..7d40f8afc 100644 --- a/web/js/map-bing-ol.js +++ b/web/js/map-bing-ol.js @@ -1,3 +1,5 @@ +var tile_base = [ [ '', 'a.', 'b.', 'c.' ], 'http://{S}tilma.mysociety.org/sv' ]; + function set_map_config(perm) { var permalink_id; if ($('#map_permalink').length) { @@ -17,6 +19,9 @@ function set_map_config(perm) { new OpenLayers.Control.Permalink(permalink_id), new OpenLayers.Control.PanZoomFMS({id: 'fms_pan_zoom' }) ]; + if (fixmystreet.map_type) { + tile_base = fixmystreet.map_type; + } fixmystreet.map_type = OpenLayers.Layer.Bing; } @@ -36,7 +41,7 @@ OpenLayers.Layer.Bing = OpenLayers.Class(OpenLayers.Layer.XYZ, { if (z >= 16) { copyrights = 'Contains Ordnance Survey data © Crown copyright and database right 2010'; } else { - logo = '<a href="http://www.bing.com/maps/"><img border=0 src="http://dev.virtualearth.net/Branding/logo_powered_by.png"></a>'; + logo = '<a href="http://www.bing.com/maps/"><img border=0 src="//dev.virtualearth.net/Branding/logo_powered_by.png"></a>'; copyrights = '© 2011 <a href="http://www.bing.com/maps/">Microsoft</a>. © AND, Navteq, Ordnance Survey'; } this.attribution = OpenLayers.String.format(this.attributionTemplate, { @@ -94,20 +99,18 @@ OpenLayers.Layer.Bing = OpenLayers.Class(OpenLayers.Layer.XYZ, { var url; if (z >= 16) { - url = [ - "http://tilma.mysociety.org/sv/${z}/${x}/${y}.png", - "http://a.tilma.mysociety.org/sv/${z}/${x}/${y}.png", - "http://b.tilma.mysociety.org/sv/${z}/${x}/${y}.png", - "http://c.tilma.mysociety.org/sv/${z}/${x}/${y}.png" - ]; + url = []; + for (var i=0; i< tile_base[0].length; i++) { + url.push( tile_base[1].replace('{S}', tile_base[0][i]) + "/${z}/${x}/${y}.png" ); + } } else { var type = ''; if (z > 10) { type = '&productSet=mmOS'; } url = [ - "http://ecn.t0.tiles.virtualearth.net/tiles/r${id}.png?g=701" + type, - "http://ecn.t1.tiles.virtualearth.net/tiles/r${id}.png?g=701" + type, - "http://ecn.t2.tiles.virtualearth.net/tiles/r${id}.png?g=701" + type, - "http://ecn.t3.tiles.virtualearth.net/tiles/r${id}.png?g=701" + type + "//ecn.t0.tiles.virtualearth.net/tiles/r${id}.png?g=701" + type, + "//ecn.t1.tiles.virtualearth.net/tiles/r${id}.png?g=701" + type, + "//ecn.t2.tiles.virtualearth.net/tiles/r${id}.png?g=701" + type, + "//ecn.t3.tiles.virtualearth.net/tiles/r${id}.png?g=701" + type ]; } var s = '' + x + y + z; |