aboutsummaryrefslogtreecommitdiffstats
path: root/perllib/FixMyStreet/Geocode/Bing.pm
diff options
context:
space:
mode:
authorStruan Donald <struan@exo.org.uk>2011-11-18 14:32:25 +0000
committerStruan Donald <struan@exo.org.uk>2011-11-18 14:32:25 +0000
commit9a83d679abbdb467ec1c363d086b35f09a4c7044 (patch)
tree30c8fece41b518080fd420d33c2aaf742ddd6ea0 /perllib/FixMyStreet/Geocode/Bing.pm
parentd941a8c26e943c941f8e37ecbd9a9982dd41cb70 (diff)
parent375610803cfcad104049ff895c77c53e6767e1e7 (diff)
Merge remote branch 'origin/master' into js-validation
Diffstat (limited to 'perllib/FixMyStreet/Geocode/Bing.pm')
-rw-r--r--perllib/FixMyStreet/Geocode/Bing.pm3
1 files changed, 2 insertions, 1 deletions
diff --git a/perllib/FixMyStreet/Geocode/Bing.pm b/perllib/FixMyStreet/Geocode/Bing.pm
index 4e12a7a7f..856d7061e 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} and $s !~ /$params->{town}/i;
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};
@@ -43,7 +44,7 @@ sub string {
if (!$js) {
return { error => _('Sorry, we could not parse that location. Please try again.') };
} elsif ($js =~ /BT\d/) {
- return { error => _("We do not cover Northern Ireland, I'm afraid, as our licence doesn't include any maps for the region.") };
+ return { error => _("We do not currently cover Northern Ireland, I'm afraid.") };
}
$js = JSON->new->utf8->allow_nonref->decode($js);