diff options
author | Matthew Somerville <matthew-github@dracos.co.uk> | 2015-02-13 12:25:34 +0000 |
---|---|---|
committer | Matthew Somerville <matthew-github@dracos.co.uk> | 2015-02-13 12:25:34 +0000 |
commit | d2569bfe991ce1635131a1b1cf67cd55c3f258a4 (patch) | |
tree | 99a9e07df04f8f8b25becf61cd09625ac1750694 /perllib/FixMyStreet/Geocode.pm | |
parent | 0db002a977d00d0a6e11333e190de4746e009bfb (diff) | |
parent | da63f72c27e16d491f9103b9a8cbdb2fd96d2b59 (diff) |
Merge branch 'issues/fms-mobile/190'
Conflicts:
perllib/FixMyStreet/Geocode/Google.pm
Diffstat (limited to 'perllib/FixMyStreet/Geocode.pm')
-rw-r--r-- | perllib/FixMyStreet/Geocode.pm | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/perllib/FixMyStreet/Geocode.pm b/perllib/FixMyStreet/Geocode.pm index 616df87b0..aac52fbaa 100644 --- a/perllib/FixMyStreet/Geocode.pm +++ b/perllib/FixMyStreet/Geocode.pm @@ -17,6 +17,7 @@ use FixMyStreet::Geocode::Bing; use FixMyStreet::Geocode::Google; use FixMyStreet::Geocode::OSM; use FixMyStreet::Geocode::Zurich; +use Utils; # lookup STRING CONTEXT # Given a user-inputted string, try and convert it into co-ordinates using either @@ -26,6 +27,11 @@ use FixMyStreet::Geocode::Zurich; sub lookup { my ($s, $c) = @_; my $data = $c->cobrand->geocode_postcode($s); + if (defined $data->{latitude}) { + ( $data->{latitude}, $data->{longitude} ) = + map { Utils::truncate_coordinate($_) } + ( $data->{latitude}, $data->{longitude} ); + } $data = string($s, $c) unless $data->{error} || defined $data->{latitude}; $data->{error} = _('Sorry, we could not find that location.') |