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 /perllib/FixMyStreet/Map/Bexley.pm | |
parent | 645c0663c4c7ce2d2d240858ed06446efe8ad328 (diff) | |
parent | fa879675558632ae54b32a10707397a01edc362d (diff) |
Merge branch 'bexley-map-tiles'
Diffstat (limited to 'perllib/FixMyStreet/Map/Bexley.pm')
-rw-r--r-- | perllib/FixMyStreet/Map/Bexley.pm | 39 |
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; + |