aboutsummaryrefslogtreecommitdiffstats
path: root/perllib/FixMyStreet/Geocode/Bing.pm
diff options
context:
space:
mode:
authorStruan Donald <struan@exo.org.uk>2011-10-18 15:45:57 +0100
committerStruan Donald <struan@exo.org.uk>2011-10-18 15:45:57 +0100
commitf524d4cbebeece580fb21a66231f2ae3d164666c (patch)
tree1712443bd16de80cdba0f28fa48a1f83a41040b5 /perllib/FixMyStreet/Geocode/Bing.pm
parent41f45b09f1c23e030a286d6f11a7bac3a34d1090 (diff)
append town name to Bing gecode queries if provided to decrease false matches
Diffstat (limited to 'perllib/FixMyStreet/Geocode/Bing.pm')
-rw-r--r--perllib/FixMyStreet/Geocode/Bing.pm1
1 files changed, 1 insertions, 0 deletions
diff --git a/perllib/FixMyStreet/Geocode/Bing.pm b/perllib/FixMyStreet/Geocode/Bing.pm
index b804102c9..962f8fe15 100644
--- a/perllib/FixMyStreet/Geocode/Bing.pm
+++ b/perllib/FixMyStreet/Geocode/Bing.pm
@@ -22,6 +22,7 @@ use Digest::MD5 qw(md5_hex);
# may be used to disambiguate the location in cobranded versions of the site.
sub string {
my ( $s, $c, $params ) = @_;
+ $s .= '+' . $params->{town} if $params->{town};
my $url = "http://dev.virtualearth.net/REST/v1/Locations?q=$s&c=en-GB"; # FIXME nb-NO for Norway
$url .= '&mapView=' . $params->{bounds}[0] . ',' . $params->{bounds}[1]
if $params->{bounds};