aboutsummaryrefslogtreecommitdiffstats
path: root/perllib/FixMyStreet/Map
diff options
context:
space:
mode:
Diffstat (limited to 'perllib/FixMyStreet/Map')
-rw-r--r--perllib/FixMyStreet/Map/Bromley.pm23
-rw-r--r--perllib/FixMyStreet/Map/FMS.pm13
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";