diff options
author | Matthew Somerville <matthew@mysociety.org> | 2020-07-09 15:41:18 +0100 |
---|---|---|
committer | Matthew Somerville <matthew@mysociety.org> | 2020-07-10 19:09:22 +0100 |
commit | 76b2704d4e9a0b0d2c8af704a68652d7b4d81780 (patch) | |
tree | cc383d14d5b1bb2758e7479b8a2232499df2bb8e /web/js | |
parent | f55c261f92ea53d5a36da5d5297394baabd740a4 (diff) |
[Bromley] Tidy up tilma URL bits.
Diffstat (limited to 'web/js')
-rw-r--r-- | web/js/map-fms.js | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/web/js/map-fms.js b/web/js/map-fms.js index 925fe1fa2..0e263c0a5 100644 --- a/web/js/map-fms.js +++ b/web/js/map-fms.js @@ -1,4 +1,4 @@ -fixmystreet.maps.tile_base = [ [ '', 'a-', 'b-', 'c-' ], '//{S}tilma.mysociety.org/oml' ]; +fixmystreet.maps.tile_base = '//{S}tilma.mysociety.org/oml'; fixmystreet.maps.config = (function(original) { return function(){ @@ -52,13 +52,15 @@ OpenLayers.Layer.BingUK = OpenLayers.Class(OpenLayers.Layer.Bing, { this._updateAttribution(copyrights, logo); }, + tile_prefix: [ '', 'a-', 'b-', 'c-' ], + get_urls: function(bounds, z) { var urls; var in_uk = this.in_uk(bounds.getCenterLonLat()); if (z >= 16 && in_uk) { urls = []; - for (var i=0; i< fixmystreet.maps.tile_base[0].length; i++) { - urls.push( fixmystreet.maps.tile_base[1].replace('{S}', fixmystreet.maps.tile_base[0][i]) + "/${z}/${x}/${y}.png" ); + for (var i=0; i< this.tile_prefix.length; i++) { + urls.push( fixmystreet.maps.tile_base.replace('{S}', this.tile_prefix[i]) + "/${z}/${x}/${y}.png" ); } } else { var type = ''; |