aboutsummaryrefslogtreecommitdiffstats
path: root/perllib/FixMyStreet/Geocode.pm
diff options
context:
space:
mode:
authorMatthew Somerville <matthew@mysociety.org>2012-07-13 15:12:06 +0100
committerMatthew Somerville <matthew@mysociety.org>2012-07-13 15:12:30 +0100
commit0000afc1f4b28c96365981fc24437a6983ee7ea2 (patch)
tree4655b42784f1906b60acd8bce3af6c8d68febc42 /perllib/FixMyStreet/Geocode.pm
parentdbeb763d227b011b42ccd44a8cb72a01dcea24ca (diff)
Add Nominatim-based geocoding service (fixes #183).
Diffstat (limited to 'perllib/FixMyStreet/Geocode.pm')
-rw-r--r--perllib/FixMyStreet/Geocode.pm7
1 files changed, 5 insertions, 2 deletions
diff --git a/perllib/FixMyStreet/Geocode.pm b/perllib/FixMyStreet/Geocode.pm
index 6ee17029a..e5983810b 100644
--- a/perllib/FixMyStreet/Geocode.pm
+++ b/perllib/FixMyStreet/Geocode.pm
@@ -12,6 +12,7 @@ use strict;
use URI::Escape;
use FixMyStreet::Geocode::Bing;
use FixMyStreet::Geocode::Google;
+use FixMyStreet::Geocode::OSM;
# lookup STRING CONTEXT
# Given a user-inputted string, try and convert it into co-ordinates using either
@@ -41,8 +42,10 @@ sub string {
my $params = $c->cobrand->disambiguate_location();
return FixMyStreet::Geocode::Bing::string($s, $c, $params)
if FixMyStreet->config('BING_MAPS_API_KEY');
- # Fall back to Google API, which allow acces with and without a key
- return FixMyStreet::Geocode::Google::string($s, $c, $params);
+ # Fall back to Google API, which allow access with and without a key
+ return FixMyStreet::Geocode::Google::string($s, $c, $params)
+ if FixMyStreet->config('GOOGLE_MAPS_API_KEY');
+ return FixMyStreet::Geocode::OSM::string($s, $c, $params);
}
1;