diff options
author | Matthew Somerville <matthew@mysociety.org> | 2012-12-04 16:10:44 +0000 |
---|---|---|
committer | Matthew Somerville <matthew@mysociety.org> | 2012-12-04 16:10:44 +0000 |
commit | 93e01b6bf2017f308b85301016f16d7e3619b314 (patch) | |
tree | 931c9168347b4fe5e33374cf3de31604b40061a5 /perllib/FixMyStreet/Geocode/OSM.pm | |
parent | 429f5b61f56519914dd38c0e62d0709d4d380dee (diff) |
Add Zurich geocoder (and allow geocoder choice to be picked in config).
Diffstat (limited to 'perllib/FixMyStreet/Geocode/OSM.pm')
-rw-r--r-- | perllib/FixMyStreet/Geocode/OSM.pm | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/perllib/FixMyStreet/Geocode/OSM.pm b/perllib/FixMyStreet/Geocode/OSM.pm index d96338c16..fd14b0acc 100644 --- a/perllib/FixMyStreet/Geocode/OSM.pm +++ b/perllib/FixMyStreet/Geocode/OSM.pm @@ -29,8 +29,13 @@ my $nominatimbase = "http://nominatim.openstreetmap.org/"; # an array of matches if there are more than one. The information in the query # may be used to disambiguate the location in cobranded versions of the site. sub string { - my ( $s, $c, $params ) = @_; + my ( $s, $c ) = @_; + + my $params = $c->cobrand->disambiguate_location($s); + + $s = FixMyStreet::Geocode::escape($s); $s .= '+' . $params->{town} if $params->{town} and $s !~ /$params->{town}/i; + my $url = "${nominatimbase}search?"; my %query_params = ( q => $s, |