aboutsummaryrefslogtreecommitdiffstats
path: root/perllib/FixMyStreet/Cobrand/Default.pm
diff options
context:
space:
mode:
Diffstat (limited to 'perllib/FixMyStreet/Cobrand/Default.pm')
-rw-r--r--perllib/FixMyStreet/Cobrand/Default.pm25
1 files changed, 14 insertions, 11 deletions
diff --git a/perllib/FixMyStreet/Cobrand/Default.pm b/perllib/FixMyStreet/Cobrand/Default.pm
index c44842dea..3dd562dc4 100644
--- a/perllib/FixMyStreet/Cobrand/Default.pm
+++ b/perllib/FixMyStreet/Cobrand/Default.pm
@@ -382,22 +382,14 @@ sub cobrand_data_for_generic_problem { '' }
Given a URL ($_[1]), QUERY, EXTRA_DATA, return a URL with any extra params
needed appended to it.
-In the default case, if we're using an OpenLayers map, we need to make
-sure zoom is always present if lat/lon are, to stop OpenLayers defaulting
-to null/0.
+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 ) = @_;
-
- {
- no warnings 'once';
- my $map_class = $FixMyStreet::Map::map_class;
- return $uri unless $map_class && $map_class =~ /FixMyStreet::Map::(OSM|FMS)/;
- }
-
- $uri->query_param( zoom => 3 )
+ $uri->query_param( zoom => $self->default_link_zoom )
if $uri->query_param('lat') && !$uri->query_param('zoom');
return $uri;
@@ -981,7 +973,18 @@ sub tweak_all_reports_map {}
sub can_support_problems { return 0; }
+=head2 default_map_zoom / default_link_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; }