diff options
author | Matthew Somerville <matthew@mysociety.org> | 2020-07-09 17:38:00 +0100 |
---|---|---|
committer | Matthew Somerville <matthew@mysociety.org> | 2020-07-10 19:13:29 +0100 |
commit | 196e3cafcfcec0cc1a050a9d07aad81156ee794e (patch) | |
tree | b77ed78b82637df17284b9fdd3f5f874e372c0d5 /web/js/map-fms.js | |
parent | 76b2704d4e9a0b0d2c8af704a68652d7b4d81780 (diff) |
Use up-to-date Bing map URLs.
Diffstat (limited to 'web/js/map-fms.js')
-rw-r--r-- | web/js/map-fms.js | 25 |
1 files changed, 12 insertions, 13 deletions
diff --git a/web/js/map-fms.js b/web/js/map-fms.js index 0e263c0a5..8af6adec3 100644 --- a/web/js/map-fms.js +++ b/web/js/map-fms.js @@ -44,9 +44,9 @@ OpenLayers.Layer.BingUK = OpenLayers.Class(OpenLayers.Layer.Bing, { } else { logo = '<a href="https://www.bing.com/maps/"><img border=0 src="//dev.virtualearth.net/Branding/logo_powered_by.png"></a>'; if (in_uk) { - copyrights = '© ' + year + ' <a href="https://www.bing.com/maps/">Microsoft</a>. © AND, Navteq, Highways England, Ordnance Survey'; + copyrights = '© ' + year + ' <a href="https://www.bing.com/maps/">Microsoft</a>, HERE, Highways England, Ordnance Survey'; } else { - copyrights = '© ' + year + ' <a href="https://www.bing.com/maps/">Microsoft</a>. © AND, Navteq, Ordnance Survey'; + copyrights = '© ' + year + ' <a href="https://www.bing.com/maps/">Microsoft</a>, HERE, Ordnance Survey'; } } this._updateAttribution(copyrights, logo); @@ -55,24 +55,23 @@ OpenLayers.Layer.BingUK = OpenLayers.Class(OpenLayers.Layer.Bing, { tile_prefix: [ '', 'a-', 'b-', 'c-' ], get_urls: function(bounds, z) { - var urls; + var urls = [], i; var in_uk = this.in_uk(bounds.getCenterLonLat()); if (z >= 16 && in_uk) { urls = []; - for (var i=0; i< this.tile_prefix.length; i++) { + for (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 if (z > 11 && in_uk) { + var type = 'g=8702&lbl=l1&productSet=mmOS&key=' + fixmystreet.key; + var tile_base = "//ecn.t{S}.tiles.virtualearth.net/tiles/r${id}?" + type; + for (i=0; i<4; i++) { + urls.push(tile_base.replace('{S}', i)); + } } else { - var type = ''; - if (z > 11 && in_uk) { - type = '&productSet=mmOS&key=' + fixmystreet.key; + for (i=0; i<4; i++) { + urls.push(this.tile_base.replace('{S}', i)); } - urls = [ - "//ecn.t0.tiles.virtualearth.net/tiles/r${id}.png?g=6570" + type, - "//ecn.t1.tiles.virtualearth.net/tiles/r${id}.png?g=6570" + type, - "//ecn.t2.tiles.virtualearth.net/tiles/r${id}.png?g=6570" + type, - "//ecn.t3.tiles.virtualearth.net/tiles/r${id}.png?g=6570" + type - ]; } return urls; }, |