diff options
author | Matthew Somerville <matthew@mysociety.org> | 2012-05-24 17:18:30 +0100 |
---|---|---|
committer | Matthew Somerville <matthew@mysociety.org> | 2012-05-24 17:18:30 +0100 |
commit | 7924150a6870603b172e322fb3476c461a25a44b (patch) | |
tree | 6734db1cc75b24bd5f9c83db2330fb976b3a8903 /web/js/map-bing-ol.js | |
parent | 16587ab94c0c09882ffb52edd73b45db8b7c98cf (diff) |
Tidy up tile domain URL generation.
Diffstat (limited to 'web/js/map-bing-ol.js')
-rw-r--r-- | web/js/map-bing-ol.js | 12 |
1 files changed, 5 insertions, 7 deletions
diff --git a/web/js/map-bing-ol.js b/web/js/map-bing-ol.js index 405195437..7d40f8afc 100644 --- a/web/js/map-bing-ol.js +++ b/web/js/map-bing-ol.js @@ -1,4 +1,4 @@ -var tile_base = 'http://{S}.tilma.mysociety.org/sv'; +var tile_base = [ [ '', 'a.', 'b.', 'c.' ], 'http://{S}tilma.mysociety.org/sv' ]; function set_map_config(perm) { var permalink_id; @@ -99,12 +99,10 @@ OpenLayers.Layer.Bing = OpenLayers.Class(OpenLayers.Layer.XYZ, { var url; if (z >= 16) { - url = [ - tile_base.replace('{S}.', '').replace('{S}-', '') + "/${z}/${x}/${y}.png", // Yuck - tile_base.replace('{S}', 'a') + "/${z}/${x}/${y}.png", - tile_base.replace('{S}', 'b') + "/${z}/${x}/${y}.png", - tile_base.replace('{S}', 'c') + "/${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'; } |