From 76b2704d4e9a0b0d2c8af704a68652d7b4d81780 Mon Sep 17 00:00:00 2001 From: Matthew Somerville Date: Thu, 9 Jul 2020 15:41:18 +0100 Subject: [Bromley] Tidy up tilma URL bits. --- perllib/FixMyStreet/Map/FMS.pm | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) (limited to 'perllib/FixMyStreet/Map/FMS.pm') diff --git a/perllib/FixMyStreet/Map/FMS.pm b/perllib/FixMyStreet/Map/FMS.pm index 126fc34bf..0cb1de553 100644 --- a/perllib/FixMyStreet/Map/FMS.pm +++ b/perllib/FixMyStreet/Map/FMS.pm @@ -18,20 +18,18 @@ sub map_javascript { [ '/js/map-fms.js', ] } -sub map_tile_base { - '-', "//%stilma.mysociety.org/oml/%d/%d/%d.png"; -} +sub map_tile_base { "oml" } sub map_tiles { my ( $self, %params ) = @_; my ( $x, $y, $z ) = ( $params{x_tile}, $params{y_tile}, $params{zoom_act} ); my $ni = in_northern_ireland_box( $params{latitude}, $params{longitude} ); if (!$ni && $z >= 16) { - my ($tile_sep, $tile_base) = $self->map_tile_base; + my $tile_base = '//%stilma.mysociety.org/' . $self->map_tile_base . '/%d/%d/%d.png'; return [ - sprintf($tile_base, 'a' . $tile_sep, $z, $x-1, $y-1), - sprintf($tile_base, 'b' . $tile_sep, $z, $x, $y-1), - sprintf($tile_base, 'c' . $tile_sep, $z, $x-1, $y), + sprintf($tile_base, 'a-', $z, $x-1, $y-1), + sprintf($tile_base, 'b-', $z, $x, $y-1), + sprintf($tile_base, 'c-', $z, $x-1, $y), sprintf($tile_base, '', $z, $x, $y), ]; } else { -- cgit v1.2.3 From 196e3cafcfcec0cc1a050a9d07aad81156ee794e Mon Sep 17 00:00:00 2001 From: Matthew Somerville Date: Thu, 9 Jul 2020 17:38:00 +0100 Subject: Use up-to-date Bing map URLs. --- perllib/FixMyStreet/Map/FMS.pm | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) (limited to 'perllib/FixMyStreet/Map/FMS.pm') diff --git a/perllib/FixMyStreet/Map/FMS.pm b/perllib/FixMyStreet/Map/FMS.pm index 0cb1de553..246d04bc0 100644 --- a/perllib/FixMyStreet/Map/FMS.pm +++ b/perllib/FixMyStreet/Map/FMS.pm @@ -32,16 +32,17 @@ sub map_tiles { sprintf($tile_base, 'c-', $z, $x-1, $y), sprintf($tile_base, '', $z, $x, $y), ]; - } else { + } elsif (!$ni && $z > 11) { my $key = FixMyStreet->config('BING_MAPS_API_KEY'); - my $url = "g=6570"; - $url .= "&productSet=mmOS&key=$key" if $z > 11 && !$ni; + my $base = "//ecn.%s.tiles.virtualearth.net/tiles/r%s?g=8702&lbl=l1&productSet=mmOS&key=$key"; return [ - "//ecn.t0.tiles.virtualearth.net/tiles/r" . $self->get_quadkey($x-1, $y-1, $z) . ".png?$url", - "//ecn.t1.tiles.virtualearth.net/tiles/r" . $self->get_quadkey($x, $y-1, $z) . ".png?$url", - "//ecn.t2.tiles.virtualearth.net/tiles/r" . $self->get_quadkey($x-1, $y, $z) . ".png?$url", - "//ecn.t3.tiles.virtualearth.net/tiles/r" . $self->get_quadkey($x, $y, $z) . ".png?$url", + sprintf($base, "t0", $self->get_quadkey($x-1, $y-1, $z)), + sprintf($base, "t1", $self->get_quadkey($x, $y-1, $z)), + sprintf($base, "t2", $self->get_quadkey($x-1, $y, $z)), + sprintf($base, "t3", $self->get_quadkey($x, $y, $z)), ]; + } else { + return $self->SUPER::map_tiles(%params); } } -- cgit v1.2.3 From 102824cc005f48ba751e8cbb445c304cc1e25098 Mon Sep 17 00:00:00 2001 From: Matthew Somerville Date: Tue, 14 Jul 2020 09:17:41 +0100 Subject: Fix non-JS aerial tile display. --- perllib/FixMyStreet/Map/FMS.pm | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'perllib/FixMyStreet/Map/FMS.pm') diff --git a/perllib/FixMyStreet/Map/FMS.pm b/perllib/FixMyStreet/Map/FMS.pm index 246d04bc0..1b556f6b3 100644 --- a/perllib/FixMyStreet/Map/FMS.pm +++ b/perllib/FixMyStreet/Map/FMS.pm @@ -24,7 +24,9 @@ sub map_tiles { my ( $self, %params ) = @_; my ( $x, $y, $z ) = ( $params{x_tile}, $params{y_tile}, $params{zoom_act} ); my $ni = in_northern_ireland_box( $params{latitude}, $params{longitude} ); - if (!$ni && $z >= 16) { + if ($params{aerial} || $ni || $z <= 11) { + return $self->SUPER::map_tiles(%params); + } elsif ($z >= 16) { my $tile_base = '//%stilma.mysociety.org/' . $self->map_tile_base . '/%d/%d/%d.png'; return [ sprintf($tile_base, 'a-', $z, $x-1, $y-1), @@ -32,7 +34,7 @@ sub map_tiles { sprintf($tile_base, 'c-', $z, $x-1, $y), sprintf($tile_base, '', $z, $x, $y), ]; - } elsif (!$ni && $z > 11) { + } elsif ($z > 11) { my $key = FixMyStreet->config('BING_MAPS_API_KEY'); my $base = "//ecn.%s.tiles.virtualearth.net/tiles/r%s?g=8702&lbl=l1&productSet=mmOS&key=$key"; return [ @@ -41,8 +43,6 @@ sub map_tiles { sprintf($base, "t2", $self->get_quadkey($x-1, $y, $z)), sprintf($base, "t3", $self->get_quadkey($x, $y, $z)), ]; - } else { - return $self->SUPER::map_tiles(%params); } } -- cgit v1.2.3 From e268e2b893aaf8a99e457c085e9c77d140b77233 Mon Sep 17 00:00:00 2001 From: M Somerville Date: Thu, 13 Aug 2020 21:15:08 +0100 Subject: Allow one more zoom level on most map types. Not on StreetView/OpenMap Local based, which are not available. --- perllib/FixMyStreet/Map/FMS.pm | 2 ++ 1 file changed, 2 insertions(+) (limited to 'perllib/FixMyStreet/Map/FMS.pm') diff --git a/perllib/FixMyStreet/Map/FMS.pm b/perllib/FixMyStreet/Map/FMS.pm index 1b556f6b3..53d911a57 100644 --- a/perllib/FixMyStreet/Map/FMS.pm +++ b/perllib/FixMyStreet/Map/FMS.pm @@ -9,6 +9,8 @@ use base 'FixMyStreet::Map::Bing'; use strict; +use constant ZOOM_LEVELS => 6; + sub map_template { 'fms' } sub map_javascript { [ -- cgit v1.2.3