aboutsummaryrefslogtreecommitdiffstats
path: root/perllib/FixMyStreet/Geocode/Bing.pm
diff options
context:
space:
mode:
Diffstat (limited to 'perllib/FixMyStreet/Geocode/Bing.pm')
-rw-r--r--perllib/FixMyStreet/Geocode/Bing.pm19
1 files changed, 9 insertions, 10 deletions
diff --git a/perllib/FixMyStreet/Geocode/Bing.pm b/perllib/FixMyStreet/Geocode/Bing.pm
index c62a87767..d7db10ae6 100644
--- a/perllib/FixMyStreet/Geocode/Bing.pm
+++ b/perllib/FixMyStreet/Geocode/Bing.pm
@@ -8,7 +8,7 @@ package FixMyStreet::Geocode::Bing;
use strict;
-use mySociety::Locale;
+use Utils;
# string STRING CONTEXT
# Looks up on Bing Maps API, and caches, a user-inputted location.
@@ -52,15 +52,14 @@ sub string {
|| $valid_locations[-1]{address}{locality} eq $_->{address}{locality}
);
- ( $latitude, $longitude ) = @{ $_->{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)
- });
- };
+ ( $latitude, $longitude ) =
+ map { Utils::truncate_coordinate($_) }
+ @{ $_->{point}->{coordinates} };
+ push (@$error, {
+ address => $address,
+ latitude => $latitude,
+ longitude => $longitude
+ });
push (@valid_locations, $_);
}