diff options
author | Matthew Somerville <matthew@mysociety.org> | 2011-08-09 10:42:15 +0100 |
---|---|---|
committer | Matthew Somerville <matthew@mysociety.org> | 2011-08-09 10:42:15 +0100 |
commit | ef421c31febe5219042468e3ec33654cf1e11556 (patch) | |
tree | ba2cb86e67eddaa3e6b0da58743c0508eb855b63 /perllib/FixMyStreet/Geocode | |
parent | 6ab7f377e14bbf83747d434241b1f1c0a26daf80 (diff) |
Store lat/lon from multiple results and use that to prevent infinite loop on e.g. 'Clapham'.
Diffstat (limited to 'perllib/FixMyStreet/Geocode')
-rw-r--r-- | perllib/FixMyStreet/Geocode/Bing.pm | 2 | ||||
-rw-r--r-- | perllib/FixMyStreet/Geocode/Google.pm | 2 |
2 files changed, 2 insertions, 2 deletions
diff --git a/perllib/FixMyStreet/Geocode/Bing.pm b/perllib/FixMyStreet/Geocode/Bing.pm index cfeffc856..90d7f98bd 100644 --- a/perllib/FixMyStreet/Geocode/Bing.pm +++ b/perllib/FixMyStreet/Geocode/Bing.pm @@ -57,7 +57,7 @@ sub string { my $address = $_->{name}; next unless $_->{address}->{countryRegion} eq 'United Kingdom'; # FIXME This is UK only ( $latitude, $longitude ) = @{ $_->{point}->{coordinates} }; - push (@$error, $address); + push (@$error, { address => $address, latitude => $latitude, longitude => $longitude }); push (@valid_locations, $_); } return { latitude => $latitude, longitude => $longitude } if scalar @valid_locations == 1; diff --git a/perllib/FixMyStreet/Geocode/Google.pm b/perllib/FixMyStreet/Geocode/Google.pm index c37a750a2..83b36dbcd 100644 --- a/perllib/FixMyStreet/Geocode/Google.pm +++ b/perllib/FixMyStreet/Geocode/Google.pm @@ -75,7 +75,7 @@ sub string { my $address = $_->{address}; next unless $c->cobrand->geocoded_string_check( $address ); ( $longitude, $latitude ) = @{ $_->{Point}->{coordinates} }; - push (@$error, $address); + push (@$error, { address => $address, latitude => $latitude, longitude => $longitude }); push (@valid_locations, $_); } return { latitude => $latitude, longitude => $longitude } if scalar @valid_locations == 1; |