diff options
Diffstat (limited to 'perllib')
-rw-r--r-- | perllib/FixMyStreet/Geocode/Bing.pm | 9 | ||||
-rw-r--r-- | perllib/FixMyStreet/Geocode/Google.pm | 9 |
2 files changed, 16 insertions, 2 deletions
diff --git a/perllib/FixMyStreet/Geocode/Bing.pm b/perllib/FixMyStreet/Geocode/Bing.pm index 4ba00dbfe..a24f7c102 100644 --- a/perllib/FixMyStreet/Geocode/Bing.pm +++ b/perllib/FixMyStreet/Geocode/Bing.pm @@ -69,7 +69,14 @@ sub string { ); ( $latitude, $longitude ) = @{ $_->{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, $_); } 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; |