aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMatthew Somerville <matthew@mysociety.org>2012-12-15 00:24:17 +0000
committerMatthew Somerville <matthew@mysociety.org>2012-12-19 14:43:26 +0000
commitcfe4fe4ec624f460a2b98600f078d08efa556bec (patch)
tree9de88f27482d5c1b2ea4ec73839d8e34f4c5fe7d
parent1c1e454cc049531fc99c5c4d4eed293aab40d406 (diff)
Fix for missing zoom in URL for OpenLayers.
-rw-r--r--perllib/FixMyStreet/Cobrand/Zurich.pm9
1 files changed, 9 insertions, 0 deletions
diff --git a/perllib/FixMyStreet/Cobrand/Zurich.pm b/perllib/FixMyStreet/Cobrand/Zurich.pm
index e5d646c8b..b4d2b8ecc 100644
--- a/perllib/FixMyStreet/Cobrand/Zurich.pm
+++ b/perllib/FixMyStreet/Cobrand/Zurich.pm
@@ -13,4 +13,13 @@ sub example_places {
return [ 'Langstrasse', 'Basteiplatz' ];
}
+# If lat/lon are in the URI, we must have zoom as well, otherwise OpenLayers defaults to 0.
+sub uri {
+ my ( $self, $uri ) = @_;
+
+ $uri->query_param( zoom => 7 )
+ if $uri->query_param('lat') && !$uri->query_param('zoom');
+ return $uri;
+}
+
1;