diff options
Diffstat (limited to 'perllib/FixMyStreet')
-rw-r--r-- | perllib/FixMyStreet/App.pm | 21 | ||||
-rw-r--r-- | perllib/FixMyStreet/Cobrand/Bristol.pm | 2 | ||||
-rw-r--r-- | perllib/FixMyStreet/Cobrand/Default.pm | 25 | ||||
-rw-r--r-- | perllib/FixMyStreet/Cobrand/Zurich.pm | 2 | ||||
-rw-r--r-- | perllib/FixMyStreet/Map/Google.pm | 1 | ||||
-rw-r--r-- | perllib/FixMyStreet/Map/OSM.pm | 1 |
6 files changed, 3 insertions, 49 deletions
diff --git a/perllib/FixMyStreet/App.pm b/perllib/FixMyStreet/App.pm index 051308920..21f9082bb 100644 --- a/perllib/FixMyStreet/App.pm +++ b/perllib/FixMyStreet/App.pm @@ -420,27 +420,6 @@ sub uri_with { return $uri; } -=head2 uri_for - - $uri = $c->uri_for( ... ); - -Like C<uri_for> except that it passes the uri to the cobrand to be altered if -needed. - -=cut - -sub uri_for { - my $c = shift; - my @args = @_; - - my $uri = $c->next::method(@args); - - my $cobranded_uri = $c->cobrand->uri($uri); - - # note that the returned uri may be a string not an object (eg cities) - return $cobranded_uri; -} - =head2 uri_for_email $uri = $c->uri_for_email( ... ); diff --git a/perllib/FixMyStreet/Cobrand/Bristol.pm b/perllib/FixMyStreet/Cobrand/Bristol.pm index 25dc5ab0a..0660acc79 100644 --- a/perllib/FixMyStreet/Cobrand/Bristol.pm +++ b/perllib/FixMyStreet/Cobrand/Bristol.pm @@ -23,8 +23,6 @@ sub map_type { 'Bristol'; } -sub default_link_zoom { 6 } - sub disambiguate_location { my $self = shift; my $string = shift; diff --git a/perllib/FixMyStreet/Cobrand/Default.pm b/perllib/FixMyStreet/Cobrand/Default.pm index 6c91da640..4c5d29ee5 100644 --- a/perllib/FixMyStreet/Cobrand/Default.pm +++ b/perllib/FixMyStreet/Cobrand/Default.pm @@ -397,25 +397,6 @@ Return cobrand extra data for the problem sub cobrand_data_for_generic_problem { '' } -=item uri - -Given a URL ($_[1]), QUERY, EXTRA_DATA, return a URL with any extra params -needed appended to it. - -In the default case, we need to make sure zoom is always present if lat/lon -are, to stop OpenLayers defaulting to null/0. - -=cut - -sub uri { - my ( $self, $uri ) = @_; - $uri->query_param( zoom => $self->default_link_zoom ) - if $uri->query_param('lat') && !$uri->query_param('zoom'); - - return $uri; -} - - =item header_params Return any params to be added to responses @@ -1002,18 +983,14 @@ sub tweak_all_reports_map {} sub can_support_problems { return 0; } -=item default_map_zoom / default_link_zoom +=item default_map_zoom default_map_zoom is used when displaying a map overriding the default of max-4 or max-3 depending on population density. -default_link_zoom is used in links that contain a 'lat' and no -zoom, to stop e.g. OpenLayers defaulting to null/0. - =cut sub default_map_zoom { undef }; -sub default_link_zoom { 3 } sub users_can_hide { return 0; } diff --git a/perllib/FixMyStreet/Cobrand/Zurich.pm b/perllib/FixMyStreet/Cobrand/Zurich.pm index 9d5ebc626..9b6a3b9cb 100644 --- a/perllib/FixMyStreet/Cobrand/Zurich.pm +++ b/perllib/FixMyStreet/Cobrand/Zurich.pm @@ -88,8 +88,6 @@ sub example_places { sub languages { [ 'de-ch,Deutsch,de_CH' ] } sub language_override { 'de-ch' } -sub default_link_zoom { 6 } - sub prettify_dt { my $self = shift; my $dt = shift; diff --git a/perllib/FixMyStreet/Map/Google.pm b/perllib/FixMyStreet/Map/Google.pm index f40eff167..c1fb05e43 100644 --- a/perllib/FixMyStreet/Map/Google.pm +++ b/perllib/FixMyStreet/Map/Google.pm @@ -44,6 +44,7 @@ sub display_map { if defined $c->get_param('lat'); $params{longitude} = Utils::truncate_coordinate($c->get_param('lon') + 0) if defined $c->get_param('lon'); + $params{zoomToBounds} = $params{any_zoom} && !defined $c->get_param('zoom'); my $zoom = defined $c->get_param('zoom') ? $c->get_param('zoom') + 0 : $default_zoom; $zoom = $numZoomLevels - 1 if $zoom >= $numZoomLevels; diff --git a/perllib/FixMyStreet/Map/OSM.pm b/perllib/FixMyStreet/Map/OSM.pm index a6a95b48b..a6cb6acea 100644 --- a/perllib/FixMyStreet/Map/OSM.pm +++ b/perllib/FixMyStreet/Map/OSM.pm @@ -57,6 +57,7 @@ sub display_map { if defined $c->get_param('lat'); $params{longitude} = Utils::truncate_coordinate($c->get_param('lon') + 0) if defined $c->get_param('lon'); + $params{zoomToBounds} = $params{any_zoom} && !defined $c->get_param('zoom'); my %data; $data{cobrand} = $c->cobrand; |