diff options
author | Matthew Somerville <matthew@mysociety.org> | 2019-09-17 15:09:40 +0100 |
---|---|---|
committer | Matthew Somerville <matthew@mysociety.org> | 2019-09-19 19:36:38 +0100 |
commit | fa879675558632ae54b32a10707397a01edc362d (patch) | |
tree | b360815811eb352c8dc021b4b17cbaab693d3aff /perllib/FixMyStreet/Geocode/OSM.pm | |
parent | c78ddc808b6d48188d7057c35718bed7f1fc28ff (diff) |
[Bexley] Add specific geocoder.
Diffstat (limited to 'perllib/FixMyStreet/Geocode/OSM.pm')
-rw-r--r-- | perllib/FixMyStreet/Geocode/OSM.pm | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/perllib/FixMyStreet/Geocode/OSM.pm b/perllib/FixMyStreet/Geocode/OSM.pm index fb7924c23..a36ae3192 100644 --- a/perllib/FixMyStreet/Geocode/OSM.pm +++ b/perllib/FixMyStreet/Geocode/OSM.pm @@ -52,14 +52,15 @@ sub string { return { error => _('Sorry, we could not find that location.') }; } - my ( $error, @valid_locations, $latitude, $longitude ); + my ( $error, @valid_locations, $latitude, $longitude, $address ); foreach (@$js) { $c->cobrand->call_hook(geocoder_munge_results => $_); ( $latitude, $longitude ) = map { Utils::truncate_coordinate($_) } ( $_->{lat}, $_->{lon} ); + $address = $_->{display_name}; push (@$error, { - address => $_->{display_name}, + address => $address, icon => $_->{icon}, latitude => $latitude, longitude => $longitude @@ -67,7 +68,7 @@ sub string { push (@valid_locations, $_); } - return { latitude => $latitude, longitude => $longitude } if scalar @valid_locations == 1; + return { latitude => $latitude, longitude => $longitude, address => $address } if scalar @valid_locations == 1; return { error => $error }; } |