diff options
author | Marius Halden <marius.h@lden.org> | 2018-06-07 13:28:45 +0200 |
---|---|---|
committer | Marius Halden <marius.h@lden.org> | 2018-06-07 13:28:45 +0200 |
commit | 956f8b8a065824f9a9dc379eba1d0aa8b1b669cf (patch) | |
tree | 49f9ccb147b18dddee97500d4df7a3fb3dd3737c /perllib/FixMyStreet/Geocode/OSM.pm | |
parent | 782457d016084c8de04989dbc824a71899f8b41b (diff) | |
parent | 4dbf5371f79c5f290c08e561ba2c881e96b58669 (diff) |
Merge tag 'v2.3.3' into fiksgatami-dev
Diffstat (limited to 'perllib/FixMyStreet/Geocode/OSM.pm')
-rw-r--r-- | perllib/FixMyStreet/Geocode/OSM.pm | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/perllib/FixMyStreet/Geocode/OSM.pm b/perllib/FixMyStreet/Geocode/OSM.pm index 020be3c2a..4d57007c5 100644 --- a/perllib/FixMyStreet/Geocode/OSM.pm +++ b/perllib/FixMyStreet/Geocode/OSM.pm @@ -26,6 +26,8 @@ sub string { my ( $s, $c ) = @_; my $params = $c->cobrand->disambiguate_location($s); + # Allow cobrand to fixup the user input + $s = $params->{string} if $params->{string}; $s = FixMyStreet::Geocode::escape($s); $s .= '+' . $params->{town} if $params->{town} and $s !~ /$params->{town}/i; @@ -39,6 +41,8 @@ sub string { ); $query_params{viewbox} = $params->{bounds}[1] . ',' . $params->{bounds}[2] . ',' . $params->{bounds}[3] . ',' . $params->{bounds}[0] if $params->{bounds}; + $query_params{bounded} = 1 + if $params->{bounds}; $query_params{countrycodes} = $params->{country} if $params->{country}; $url .= join('&', map { "$_=$query_params{$_}" } sort keys %query_params); @@ -50,11 +54,13 @@ sub string { my ( $error, @valid_locations, $latitude, $longitude ); foreach (@$js) { + $c->cobrand->call_hook(geocoder_munge_results => $_); ( $latitude, $longitude ) = map { Utils::truncate_coordinate($_) } ( $_->{lat}, $_->{lon} ); push (@$error, { address => $_->{display_name}, + icon => $_->{icon}, latitude => $latitude, longitude => $longitude }); |