aboutsummaryrefslogtreecommitdiffstats
path: root/perllib/FixMyStreet/Geocode
diff options
context:
space:
mode:
authorAnders Einar Hilden <hildenae@gmail.com>2012-05-10 21:20:36 +0300
committerAnders Einar Hilden <hildenae@gmail.com>2012-05-10 21:20:36 +0300
commit87c051bc46bdc00abf90e8030468061ac82fe9b2 (patch)
tree56ed3587ae8e1fadaea4a4fd2beae67a91055b41 /perllib/FixMyStreet/Geocode
parent2ecaa78941ccba06d25514c43944cedda1cc67dd (diff)
Fix bug wherein links on multiple result pages in other locales would not work. Ported from Bing.pm
Diffstat (limited to 'perllib/FixMyStreet/Geocode')
-rw-r--r--perllib/FixMyStreet/Geocode/Google.pm9
1 files changed, 8 insertions, 1 deletions
diff --git a/perllib/FixMyStreet/Geocode/Google.pm b/perllib/FixMyStreet/Geocode/Google.pm
index 83b36dbcd..1ab347066 100644
--- a/perllib/FixMyStreet/Geocode/Google.pm
+++ b/perllib/FixMyStreet/Geocode/Google.pm
@@ -75,7 +75,14 @@ sub string {
my $address = $_->{address};
next unless $c->cobrand->geocoded_string_check( $address );
( $longitude, $latitude ) = @{ $_->{Point}->{coordinates} };
- push (@$error, { address => $address, latitude => $latitude, longitude => $longitude });
+ # These co-ordinates are output as query parameters in a URL, make sure they have a "."
+ mySociety::Locale::in_gb_locale {
+ push (@$error, {
+ address => $address,
+ latitude => sprintf('%0.6f', $latitude),
+ longitude => sprintf('%0.6f', $longitude)
+ });
+ };
push (@valid_locations, $_);
}
return { latitude => $latitude, longitude => $longitude } if scalar @valid_locations == 1;