aboutsummaryrefslogtreecommitdiffstats
path: root/perllib/FixMyStreet/Geocode/Google.pm
diff options
context:
space:
mode:
authorMatthew Somerville <matthew-github@dracos.co.uk>2015-02-13 12:25:34 +0000
committerMatthew Somerville <matthew-github@dracos.co.uk>2015-02-13 12:25:34 +0000
commitd2569bfe991ce1635131a1b1cf67cd55c3f258a4 (patch)
tree99a9e07df04f8f8b25becf61cd09625ac1750694 /perllib/FixMyStreet/Geocode/Google.pm
parent0db002a977d00d0a6e11333e190de4746e009bfb (diff)
parentda63f72c27e16d491f9103b9a8cbdb2fd96d2b59 (diff)
Merge branch 'issues/fms-mobile/190'
Conflicts: perllib/FixMyStreet/Geocode/Google.pm
Diffstat (limited to 'perllib/FixMyStreet/Geocode/Google.pm')
-rw-r--r--perllib/FixMyStreet/Geocode/Google.pm19
1 files changed, 9 insertions, 10 deletions
diff --git a/perllib/FixMyStreet/Geocode/Google.pm b/perllib/FixMyStreet/Geocode/Google.pm
index 8d3280ae7..35fcec36f 100644
--- a/perllib/FixMyStreet/Geocode/Google.pm
+++ b/perllib/FixMyStreet/Geocode/Google.pm
@@ -7,7 +7,7 @@
package FixMyStreet::Geocode::Google;
use strict;
-use mySociety::Locale;
+use Utils;
# string STRING CONTEXT
# Looks up on Google Maps API, and caches, a user-inputted location.
@@ -53,15 +53,14 @@ sub string {
next unless $_->{AddressDetails}->{Accuracy} >= 4;
my $address = $_->{address};
next unless $c->cobrand->geocoded_string_check( $address );
- ( $longitude, $latitude ) = @{ $_->{Point}->{coordinates} };
- # 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)
- });
- };
+ ( $longitude, $latitude ) =
+ map { Utils::truncate_coordinate($_) }
+ @{ $_->{Point}->{coordinates} };
+ push (@$error, {
+ address => $address,
+ latitude => $latitude,
+ longitude => $longitude
+ });
push (@valid_locations, $_);
}
return { latitude => $latitude, longitude => $longitude } if scalar @valid_locations == 1;