diff options
Diffstat (limited to 'perllib/FixMyStreet/Geocode')
-rw-r--r-- | perllib/FixMyStreet/Geocode/Bing.pm | 8 | ||||
-rw-r--r-- | perllib/FixMyStreet/Geocode/Google.pm | 2 | ||||
-rw-r--r-- | perllib/FixMyStreet/Geocode/OSM.pm | 2 | ||||
-rw-r--r-- | perllib/FixMyStreet/Geocode/Zurich.pm | 2 |
4 files changed, 10 insertions, 4 deletions
diff --git a/perllib/FixMyStreet/Geocode/Bing.pm b/perllib/FixMyStreet/Geocode/Bing.pm index 9e425441a..ee5e15f8c 100644 --- a/perllib/FixMyStreet/Geocode/Bing.pm +++ b/perllib/FixMyStreet/Geocode/Bing.pm @@ -11,13 +11,19 @@ use strict; use FixMyStreet::Geocode; use Utils; +sub setup { + my $cls = shift; + return 1 if FixMyStreet->config('BING_MAPS_API_KEY'); + return 0; +} + # string STRING CONTEXT # Looks up on Bing Maps API, and caches, a user-inputted location. # Returns array of (LAT, LON, ERROR), where ERROR is either undef, a string, or # 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 ) = @_; + my ( $cls, $s, $c ) = @_; my $params = $c->cobrand->disambiguate_location($s); # Allow cobrand to fixup the user input diff --git a/perllib/FixMyStreet/Geocode/Google.pm b/perllib/FixMyStreet/Geocode/Google.pm index ad1881541..455d9cec0 100644 --- a/perllib/FixMyStreet/Geocode/Google.pm +++ b/perllib/FixMyStreet/Geocode/Google.pm @@ -16,7 +16,7 @@ use URI::Escape; # 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 ) = @_; + my ( $cls, $s, $c ) = @_; my $params = $c->cobrand->disambiguate_location($s); # Allow cobrand to fixup the user input diff --git a/perllib/FixMyStreet/Geocode/OSM.pm b/perllib/FixMyStreet/Geocode/OSM.pm index 0d296f299..fb7924c23 100644 --- a/perllib/FixMyStreet/Geocode/OSM.pm +++ b/perllib/FixMyStreet/Geocode/OSM.pm @@ -23,7 +23,7 @@ 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 ) = @_; + my ( $cls, $s, $c ) = @_; my $params = $c->cobrand->disambiguate_location($s); # Allow cobrand to fixup the user input diff --git a/perllib/FixMyStreet/Geocode/Zurich.pm b/perllib/FixMyStreet/Geocode/Zurich.pm index c7bd9e9d9..38df431c9 100644 --- a/perllib/FixMyStreet/Geocode/Zurich.pm +++ b/perllib/FixMyStreet/Geocode/Zurich.pm @@ -60,7 +60,7 @@ sub setup_soap { # versions of the site. sub string { - my ( $s, $c ) = @_; + my ( $cls, $s, $c ) = @_; setup_soap(); |