diff options
Diffstat (limited to 'perllib/FixMyStreet/Geocode')
-rw-r--r-- | perllib/FixMyStreet/Geocode/Bexley.pm | 2 | ||||
-rw-r--r-- | perllib/FixMyStreet/Geocode/Bing.pm | 1 | ||||
-rw-r--r-- | perllib/FixMyStreet/Geocode/Google.pm | 1 | ||||
-rw-r--r-- | perllib/FixMyStreet/Geocode/OSM.pm | 1 | ||||
-rw-r--r-- | perllib/FixMyStreet/Geocode/Zurich.pm | 1 |
5 files changed, 6 insertions, 0 deletions
diff --git a/perllib/FixMyStreet/Geocode/Bexley.pm b/perllib/FixMyStreet/Geocode/Bexley.pm index a70a42cd1..8a1a886bb 100644 --- a/perllib/FixMyStreet/Geocode/Bexley.pm +++ b/perllib/FixMyStreet/Geocode/Bexley.pm @@ -23,6 +23,8 @@ sub string { my $js = query_layer($s); return $osm unless $js && @{$js->{features}}; + $c->stash->{geocoder_url} = $s; + my ( $error, @valid_locations, $latitude, $longitude, $address ); foreach (sort { $a->{properties}{ADDRESS} cmp $b->{properties}{ADDRESS} } @{$js->{features}}) { my @lines = @{$_->{geometry}{coordinates}}; diff --git a/perllib/FixMyStreet/Geocode/Bing.pm b/perllib/FixMyStreet/Geocode/Bing.pm index ee5e15f8c..1d39d911f 100644 --- a/perllib/FixMyStreet/Geocode/Bing.pm +++ b/perllib/FixMyStreet/Geocode/Bing.pm @@ -38,6 +38,7 @@ sub string { $url .= '&userLocation=' . $params->{centre} if $params->{centre}; $url .= '&c=' . $params->{bing_culture} if $params->{bing_culture}; + $c->stash->{geocoder_url} = $url; my $js = FixMyStreet::Geocode::cache('bing', $url, 'key=' . FixMyStreet->config('BING_MAPS_API_KEY')); if (!$js) { return { error => _('Sorry, we could not parse that location. Please try again.') }; diff --git a/perllib/FixMyStreet/Geocode/Google.pm b/perllib/FixMyStreet/Geocode/Google.pm index 455d9cec0..ffbad96ba 100644 --- a/perllib/FixMyStreet/Geocode/Google.pm +++ b/perllib/FixMyStreet/Geocode/Google.pm @@ -49,6 +49,7 @@ sub string { $url .= '&components=' . $components if $components; + $c->stash->{geocoder_url} = $url; my $args = 'key=' . FixMyStreet->config('GOOGLE_MAPS_API_KEY'); my $js = FixMyStreet::Geocode::cache('google', $url, $args, qr/"status"\s*:\s*"(OVER_QUERY_LIMIT|REQUEST_DENIED|INVALID_REQUEST|UNKNOWN_ERROR)"/); if (!$js) { diff --git a/perllib/FixMyStreet/Geocode/OSM.pm b/perllib/FixMyStreet/Geocode/OSM.pm index b979e2a10..20e653cf6 100644 --- a/perllib/FixMyStreet/Geocode/OSM.pm +++ b/perllib/FixMyStreet/Geocode/OSM.pm @@ -47,6 +47,7 @@ sub string { if $params->{country}; $url .= join('&', map { "$_=$query_params{$_}" } sort keys %query_params); + $c->stash->{geocoder_url} = $url; my $js = FixMyStreet::Geocode::cache('osm', $url); if (!$js) { return { error => _('Sorry, we could not find that location.') }; diff --git a/perllib/FixMyStreet/Geocode/Zurich.pm b/perllib/FixMyStreet/Geocode/Zurich.pm index 0b85ab7b2..b0c0b528e 100644 --- a/perllib/FixMyStreet/Geocode/Zurich.pm +++ b/perllib/FixMyStreet/Geocode/Zurich.pm @@ -97,6 +97,7 @@ sub string { my $cache_dir = path(FixMyStreet->config('GEO_CACHE'), 'zurich')->absolute(FixMyStreet->path_to()); my $cache_file = $cache_dir->child(md5_hex($s)); my $result; + $c->stash->{geocoder_url} = $s; if (-s $cache_file && -M $cache_file <= 7 && !FixMyStreet->config('STAGING_SITE')) { $result = retrieve($cache_file); } else { |