diff options
author | Matthew Somerville <matthew@mysociety.org> | 2019-09-19 20:27:46 +0100 |
---|---|---|
committer | Matthew Somerville <matthew@mysociety.org> | 2019-09-19 20:27:46 +0100 |
commit | 9d12ecc52d5a3413b12d3781349e228026e79f5e (patch) | |
tree | b3fdabfa42cf0c7264f5ecb29ccb6a8637fb0107 /web/js | |
parent | 645c0663c4c7ce2d2d240858ed06446efe8ad328 (diff) | |
parent | fa879675558632ae54b32a10707397a01edc362d (diff) |
Merge branch 'bexley-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" +}); |