diff options
author | Matthew Somerville <matthew@mysociety.org> | 2011-11-11 16:29:14 +0000 |
---|---|---|
committer | Matthew Somerville <matthew@mysociety.org> | 2011-11-11 16:29:14 +0000 |
commit | 3ca55b28bb78d781824b88d333a38bfd598f8a16 (patch) | |
tree | 58294f2d66e8abd53f3e197dfc525818be71f1a8 | |
parent | 84d178250f52e53f66d7f6ec331fde8076ffe0e4 (diff) |
Don't request tiles at level they don't exist.
-rw-r--r-- | perllib/FixMyStreet/Map/FMS.pm | 10 | ||||
-rw-r--r-- | web/js/map-bing-ol.js | 10 |
2 files changed, 12 insertions, 8 deletions
diff --git a/perllib/FixMyStreet/Map/FMS.pm b/perllib/FixMyStreet/Map/FMS.pm index d5edac763..24842c861 100644 --- a/perllib/FixMyStreet/Map/FMS.pm +++ b/perllib/FixMyStreet/Map/FMS.pm @@ -47,11 +47,13 @@ sub map_tiles { "http://tilma.mysociety.org/sv/$z/$x/$y.png", ]; } else { + my $url = "g=701"; + $url .= "&productSet=mmOS" if $z > 10; return [ - "http://ecn.t0.tiles.virtualearth.net/tiles/r" . get_quadkey($x-1, $y-1, $z) . ".png?g=701&productSet=mmOS", - "http://ecn.t1.tiles.virtualearth.net/tiles/r" . get_quadkey($x, $y-1, $z) . ".png?g=701&productSet=mmOS", - "http://ecn.t2.tiles.virtualearth.net/tiles/r" . get_quadkey($x-1, $y, $z) . ".png?g=701&productSet=mmOS", - "http://ecn.t3.tiles.virtualearth.net/tiles/r" . get_quadkey($x, $y, $z) . ".png?g=701&productSet=mmOS", + "http://ecn.t0.tiles.virtualearth.net/tiles/r" . get_quadkey($x-1, $y-1, $z) . ".png?$url", + "http://ecn.t1.tiles.virtualearth.net/tiles/r" . get_quadkey($x, $y-1, $z) . ".png?$url", + "http://ecn.t2.tiles.virtualearth.net/tiles/r" . get_quadkey($x-1, $y, $z) . ".png?$url", + "http://ecn.t3.tiles.virtualearth.net/tiles/r" . get_quadkey($x, $y, $z) . ".png?$url", ]; } } diff --git a/web/js/map-bing-ol.js b/web/js/map-bing-ol.js index 391f837c6..9f8dc9599 100644 --- a/web/js/map-bing-ol.js +++ b/web/js/map-bing-ol.js @@ -88,11 +88,13 @@ OpenLayers.Layer.Bing = OpenLayers.Class(OpenLayers.Layer.XYZ, { "http://c.tilma.mysociety.org/sv/${z}/${x}/${y}.png" ]; } else { + var type = ''; + if (z > 10) type = '&productSet=mmOS'; var url = [ - "http://ecn.t0.tiles.virtualearth.net/tiles/r${id}.png?g=701&productSet=mmOS", - "http://ecn.t1.tiles.virtualearth.net/tiles/r${id}.png?g=701&productSet=mmOS", - "http://ecn.t2.tiles.virtualearth.net/tiles/r${id}.png?g=701&productSet=mmOS", - "http://ecn.t3.tiles.virtualearth.net/tiles/r${id}.png?g=701&productSet=mmOS" + "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, ]; } var s = '' + x + y + z; |