aboutsummaryrefslogtreecommitdiffstats
path: root/perllib/FixMyStreet/Geocode
diff options
context:
space:
mode:
authorMatthew Somerville <matthew@mysociety.org>2012-05-16 14:30:30 +0100
committerMatthew Somerville <matthew@mysociety.org>2012-05-16 14:30:30 +0100
commitd9f3bd47a94116871893f0417e7c836400bb04eb (patch)
tree1c140a6cb9ea3fd60dbf1532d2cb0bcfdaa703ad /perllib/FixMyStreet/Geocode
parent1ba0a33c9fa19f2fa46f16678785d1c90ed33eb0 (diff)
parent194173589eed229567646cedfc0e32621d18f1e7 (diff)
Merge branch 'master' into bromley
Conflicts: bin/send-reports conf/crontab.ugly conf/general.yml-example db/schema.sql perllib/FixMyStreet/App/Controller/Admin.pm perllib/FixMyStreet/App/Controller/Report/New.pm perllib/FixMyStreet/DB/Result/Comment.pm perllib/FixMyStreet/DB/Result/Open311conf.pm perllib/FixMyStreet/DB/Result/Problem.pm perllib/FixMyStreet/DB/Result/User.pm templates/web/default/js/validation_strings.html templates/web/fixmystreet/auth/sign_out.html templates/web/fixmystreet/report/new/councils_text_all.html web/cobrands/fixmystreet/_base.scss
Diffstat (limited to 'perllib/FixMyStreet/Geocode')
-rw-r--r--perllib/FixMyStreet/Geocode/Bing.pm9
-rw-r--r--perllib/FixMyStreet/Geocode/Google.pm9
2 files changed, 16 insertions, 2 deletions
diff --git a/perllib/FixMyStreet/Geocode/Bing.pm b/perllib/FixMyStreet/Geocode/Bing.pm
index 0a7fc38dc..3bbb9dcdc 100644
--- a/perllib/FixMyStreet/Geocode/Bing.pm
+++ b/perllib/FixMyStreet/Geocode/Bing.pm
@@ -71,7 +71,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;