aboutsummaryrefslogtreecommitdiffstats
path: root/perllib/FixMyStreet/Map/Bexley.pm
diff options
context:
space:
mode:
authorMatthew Somerville <matthew@mysociety.org>2019-09-16 14:55:45 +0100
committerMatthew Somerville <matthew@mysociety.org>2019-09-19 16:11:08 +0100
commitcc2ca7a697e1750ef197e222a1d45c4b345e61d4 (patch)
tree7db9414a7b0905ac72eb595eb3d8195840f22b79 /perllib/FixMyStreet/Map/Bexley.pm
parent5bf5c08a3a25c91866ce478f01fc6c4ad9d25eb6 (diff)
[Bexley] Add new map tiles.
Diffstat (limited to 'perllib/FixMyStreet/Map/Bexley.pm')
-rw-r--r--perllib/FixMyStreet/Map/Bexley.pm39
1 files changed, 39 insertions, 0 deletions
diff --git a/perllib/FixMyStreet/Map/Bexley.pm b/perllib/FixMyStreet/Map/Bexley.pm
new file mode 100644
index 000000000..d3c7a013a
--- /dev/null
+++ b/perllib/FixMyStreet/Map/Bexley.pm
@@ -0,0 +1,39 @@
+# FixMyStreet:Map::Bexley
+#
+# A combination of FMS OS maps and our own tiles
+
+package FixMyStreet::Map::Bexley;
+use base 'FixMyStreet::Map::FMS';
+
+use strict;
+
+use constant ZOOM_LEVELS => 7;
+
+sub map_template { 'fms' }
+
+sub map_javascript { [
+ '/vendor/OpenLayers/OpenLayers.wfs.js',
+ '/js/map-OpenLayers.js',
+ '/js/map-bing-ol.js',
+ '/js/map-fms.js',
+ '/js/map-bexley.js',
+] }
+
+sub map_tiles {
+ my ( $self, %params ) = @_;
+ my ( $x, $y, $z ) = ( $params{x_tile}, $params{y_tile}, $params{zoom_act} );
+ if ($z >= 17) {
+ my $base = "//%stilma.mysociety.org/bexley/%d/%d/%d.png";
+ return [
+ sprintf($base, 'a.', $z, $x-1, $y-1),
+ sprintf($base, 'b.', $z, $x, $y-1),
+ sprintf($base, 'c.', $z, $x-1, $y),
+ sprintf($base, '', $z, $x, $y),
+ ];
+ } else {
+ return $self->SUPER::map_tiles(%params);
+ }
+}
+
+1;
+