diff options
-rw-r--r-- | perllib/FixMyStreet/Geocode.pm | 16 |
1 files changed, 9 insertions, 7 deletions
diff --git a/perllib/FixMyStreet/Geocode.pm b/perllib/FixMyStreet/Geocode.pm index ae85aba15..892077d6e 100644 --- a/perllib/FixMyStreet/Geocode.pm +++ b/perllib/FixMyStreet/Geocode.pm @@ -65,13 +65,15 @@ sub geocoded_string_coordinates { } elsif ( $js =~ /"coordinates" *: *\[ *(.*?), *(.*?),/ ) { $longitude = $1; $latitude = $2; - try { - my ($easting, $northing) = Utils::convert_latlon_to_en( $latitude, $longitude ); - } catch Error::Simple with { - mySociety::Locale::pop(); # We threw exception, so it won't have happened. - $error = shift; - $error = _('That location does not appear to be in Britain; please try again.') - if $error =~ /out of the area covered/; + if (mySociety::Config::get('COUNTRY') eq 'GB') { + try { + my ($easting, $northing) = Utils::convert_latlon_to_en( $latitude, $longitude ); + } catch Error::Simple with { + mySociety::Locale::pop(); # We threw exception, so it won't have happened. + $error = shift; + $error = _('That location does not appear to be in Britain; please try again.') + if $error =~ /out of the area covered/; + } } } return ($latitude, $longitude, $error); |