aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEdmund von der Burg <evdb@mysociety.org>2011-04-15 14:53:15 +0100
committerEdmund von der Burg <evdb@mysociety.org>2011-04-15 15:11:07 +0100
commitcbecebc34457364e4d1cbc50427748aeb5b187ab (patch)
tree3428a5fc77d8a21c563082c6c2823e3ac6403aeb
parent502409482509c8ba6f085881553c894954ad2c65 (diff)
Added missing url and geocoded_string_check methods
-rw-r--r--perllib/FixMyStreet/Cobrand/FiksGataMi.pm17
1 files changed, 16 insertions, 1 deletions
diff --git a/perllib/FixMyStreet/Cobrand/FiksGataMi.pm b/perllib/FixMyStreet/Cobrand/FiksGataMi.pm
index 43565d8ea..00655afc9 100644
--- a/perllib/FixMyStreet/Cobrand/FiksGataMi.pm
+++ b/perllib/FixMyStreet/Cobrand/FiksGataMi.pm
@@ -34,5 +34,20 @@ sub area_min_generation {
return '';
}
-1;
+# If lat/lon are present in the URL, OpenLayers will use that to centre the map.
+# Need to specify a zoom to stop it defaulting to null/0.
+sub url {
+ my ( $self, $url ) = @_;
+ if ( $url =~ /lat=/ && $url !~ /zoom=/ ) {
+ $url .= ';zoom=2';
+ }
+ return $url;
+}
+sub geocoded_string_check {
+ my ( $self, $s ) = @_;
+ return 1 if $s =~ /, Norge/;
+ return 0;
+}
+
+1;