diff options
author | Matthew Somerville <matthew@mysociety.org> | 2012-05-11 10:44:51 +0100 |
---|---|---|
committer | Matthew Somerville <matthew@mysociety.org> | 2012-05-11 10:44:51 +0100 |
commit | 2992b617968aa7d9b254673eb26283066af5ad56 (patch) | |
tree | 45df4964fc7d4e114150503c88b1fe9c95aba2ae /perllib/FixMyStreet/Map | |
parent | 5e2a8889e27340dee9207d2360077973c9f8ba38 (diff) |
Different map base for Bromley.
Diffstat (limited to 'perllib/FixMyStreet/Map')
-rw-r--r-- | perllib/FixMyStreet/Map/Bromley.pm | 23 | ||||
-rw-r--r-- | perllib/FixMyStreet/Map/FMS.pm | 13 |
2 files changed, 32 insertions, 4 deletions
diff --git a/perllib/FixMyStreet/Map/Bromley.pm b/perllib/FixMyStreet/Map/Bromley.pm new file mode 100644 index 000000000..6d9dfa742 --- /dev/null +++ b/perllib/FixMyStreet/Map/Bromley.pm @@ -0,0 +1,23 @@ +#!/usr/bin/perl +# +# FixMyStreet:Map::Bromley +# Bromley have slightly different tiles, with trees etc. +# +# Copyright (c) 2012 UK Citizens Online Democracy. All rights reserved. +# Email: matthew@mysociety.org; WWW: http://www.mysociety.org/ + +package FixMyStreet::Map::Bromley; +use base 'FixMyStreet::Map::FMS'; + +use strict; + +sub map_type { + my $self = shift; + return '"' . $self->map_tile_base . '"'; +} + +sub map_tile_base { + return "tilma.mysociety.org/bromley"; +} + +1; diff --git a/perllib/FixMyStreet/Map/FMS.pm b/perllib/FixMyStreet/Map/FMS.pm index 24842c861..0ea4af4c1 100644 --- a/perllib/FixMyStreet/Map/FMS.pm +++ b/perllib/FixMyStreet/Map/FMS.pm @@ -37,14 +37,19 @@ sub get_quadkey { return $key; } +sub map_tile_base { + "tilma.mysociety.org/sv"; +} + sub map_tiles { my ($self, $x, $y, $z) = @_; if ($z >= 16) { + my $tile_base = $self->map_tile_base; return [ - "http://a.tilma.mysociety.org/sv/$z/" . ($x-1) . "/" . ($y-1) . ".png", - "http://b.tilma.mysociety.org/sv/$z/$x/" . ($y-1) . ".png", - "http://c.tilma.mysociety.org/sv/$z/" . ($x-1) . "/$y.png", - "http://tilma.mysociety.org/sv/$z/$x/$y.png", + "http://a.$tile_base/$z/" . ($x-1) . "/" . ($y-1) . ".png", + "http://b.$tile_base/$z/$x/" . ($y-1) . ".png", + "http://c.$tile_base/$z/" . ($x-1) . "/$y.png", + "http://$tile_base/$z/$x/$y.png", ]; } else { my $url = "g=701"; |