diff options
author | Matthew Somerville <matthew@mysociety.org> | 2019-09-16 14:55:45 +0100 |
---|---|---|
committer | Matthew Somerville <matthew@mysociety.org> | 2019-09-19 16:11:08 +0100 |
commit | cc2ca7a697e1750ef197e222a1d45c4b345e61d4 (patch) | |
tree | 7db9414a7b0905ac72eb595eb3d8195840f22b79 /web/js | |
parent | 5bf5c08a3a25c91866ce478f01fc6c4ad9d25eb6 (diff) |
[Bexley] Add new map tiles.
Diffstat (limited to 'web/js')
-rw-r--r-- | web/js/map-bexley.js | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/web/js/map-bexley.js b/web/js/map-bexley.js new file mode 100644 index 000000000..38911f950 --- /dev/null +++ b/web/js/map-bexley.js @@ -0,0 +1,24 @@ +fixmystreet.maps.config = (function(original) { + return function(){ + original(); + fixmystreet.map_type = OpenLayers.Layer.Bexley; + }; +})(fixmystreet.maps.config); + +OpenLayers.Layer.Bexley = OpenLayers.Class(OpenLayers.Layer.BingUK, { + get_urls: function(bounds, z) { + if (z < 17) { + return OpenLayers.Layer.BingUK.prototype.get_urls.apply(this, arguments); + } + + var urls = []; + var servers = [ '', 'a.', 'b.', 'c.' ]; + var base = "//{S}tilma.mysociety.org/bexley/${z}/${x}/${y}.png"; + for (var i=0; i < servers.length; i++) { + urls.push( base.replace('{S}', servers[i]) ); + } + return urls; + }, + + CLASS_NAME: "OpenLayers.Layer.Bexley" +}); |