diff options
author | Matthew Somerville <matthew@mysociety.org> | 2012-05-24 15:02:46 +0100 |
---|---|---|
committer | Matthew Somerville <matthew@mysociety.org> | 2012-05-24 15:16:00 +0100 |
commit | 16587ab94c0c09882ffb52edd73b45db8b7c98cf (patch) | |
tree | 3e4a13bc3e5ec3b7eafc53c1160b9748c2de793b | |
parent | 65820a534a42852d0d9a1819649f48a54b37c22f (diff) |
Multiple domains for Bromley tiles.
-rw-r--r-- | perllib/FixMyStreet/Map/Bromley.pm | 4 | ||||
-rw-r--r-- | perllib/FixMyStreet/Map/FMS.pm | 10 | ||||
-rw-r--r-- | web/js/map-bing-ol.js | 20 |
3 files changed, 14 insertions, 20 deletions
diff --git a/perllib/FixMyStreet/Map/Bromley.pm b/perllib/FixMyStreet/Map/Bromley.pm index 836efed39..4f4c2fae8 100644 --- a/perllib/FixMyStreet/Map/Bromley.pm +++ b/perllib/FixMyStreet/Map/Bromley.pm @@ -12,11 +12,11 @@ use base 'FixMyStreet::Map::FMS'; use strict; sub map_type { - return '"/tilma"'; + return '"https://{S}-fix.bromley.gov.uk/tilma"'; } sub map_tile_base { - "/tilma/%d/%d/%d.png"; + '-', "https://%sfix.bromley.gov.uk/tilma/%d/%d/%d.png"; } 1; diff --git a/perllib/FixMyStreet/Map/FMS.pm b/perllib/FixMyStreet/Map/FMS.pm index 4d0af983b..b1dd29002 100644 --- a/perllib/FixMyStreet/Map/FMS.pm +++ b/perllib/FixMyStreet/Map/FMS.pm @@ -38,17 +38,17 @@ sub get_quadkey { } sub map_tile_base { - "http://%stilma.mysociety.org/sv/%d/%d/%d.png"; + '.', "http://%stilma.mysociety.org/sv/%d/%d/%d.png"; } sub map_tiles { my ($self, $x, $y, $z) = @_; if ($z >= 16) { - my $tile_base = $self->map_tile_base; + my ($tile_sep, $tile_base) = $self->map_tile_base; return [ - sprintf($tile_base, 'a.', $z, $x-1, $y-1), - sprintf($tile_base, 'b.', $z, $x, $y-1), - sprintf($tile_base, 'c.', $z, $x-1, $y), + sprintf($tile_base, 'a' . $tile_sep, $z, $x-1, $y-1), + sprintf($tile_base, 'b' . $tile_sep, $z, $x, $y-1), + sprintf($tile_base, 'c' . $tile_sep, $z, $x-1, $y), sprintf($tile_base, '', $z, $x, $y), ]; } else { diff --git a/web/js/map-bing-ol.js b/web/js/map-bing-ol.js index 9bff93e27..405195437 100644 --- a/web/js/map-bing-ol.js +++ b/web/js/map-bing-ol.js @@ -1,4 +1,4 @@ -var tile_base = 'tilma.mysociety.org/sv'; +var tile_base = 'http://{S}.tilma.mysociety.org/sv'; function set_map_config(perm) { var permalink_id; @@ -99,18 +99,12 @@ OpenLayers.Layer.Bing = OpenLayers.Class(OpenLayers.Layer.XYZ, { var url; if (z >= 16) { - if (tile_base.substring(0,1) == '/') { - url = [ - tile_base + "/${z}/${x}/${y}.png" - ]; - } else { - url = [ - "http://" + tile_base + "/${z}/${x}/${y}.png", - "http://a." + tile_base + "/${z}/${x}/${y}.png", - "http://b." + tile_base + "/${z}/${x}/${y}.png", - "http://c." + tile_base + "/${z}/${x}/${y}.png" - ]; - } + 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" + ]; } else { var type = ''; if (z > 10) { type = '&productSet=mmOS'; } |