diff options
Diffstat (limited to 'perllib/FixMyStreet')
-rw-r--r-- | perllib/FixMyStreet/Cobrand/Bexley.pm | 2 | ||||
-rw-r--r-- | perllib/FixMyStreet/Map/Bexley.pm | 39 |
2 files changed, 40 insertions, 1 deletions
diff --git a/perllib/FixMyStreet/Cobrand/Bexley.pm b/perllib/FixMyStreet/Cobrand/Bexley.pm index a395543bd..1a4b698df 100644 --- a/perllib/FixMyStreet/Cobrand/Bexley.pm +++ b/perllib/FixMyStreet/Cobrand/Bexley.pm @@ -9,7 +9,7 @@ sub council_area { 'Bexley' } sub council_name { 'London Borough of Bexley' } sub council_url { 'bexley' } sub get_geocoder { 'OSM' } -sub map_type { 'OSM' } +sub map_type { 'Bexley' } sub disambiguate_location { my $self = shift; 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; + |