aboutsummaryrefslogtreecommitdiffstats
path: root/perllib
diff options
context:
space:
mode:
authorMatthew Somerville <matthew-github@dracos.co.uk>2017-05-23 09:49:12 +0100
committerMatthew Somerville <matthew-github@dracos.co.uk>2017-05-23 09:49:12 +0100
commit8ccf0d95199e026c202a4bede9b45e646744423e (patch)
treeead46cfa384c5ae34718671e2201f3afe7e7c975 /perllib
parent082f2c31c8dc94fe5e2492b0dd3ad65c4db9f2c1 (diff)
parent675744156c56d7b5ea5c8866fdd59a1c3cbcee1b (diff)
Merge branch '1695-scientific-no-tation'
Diffstat (limited to 'perllib')
-rw-r--r--perllib/FixMyStreet/Cobrand/UK.pm4
1 files changed, 3 insertions, 1 deletions
diff --git a/perllib/FixMyStreet/Cobrand/UK.pm b/perllib/FixMyStreet/Cobrand/UK.pm
index 46891f906..1a5682dad 100644
--- a/perllib/FixMyStreet/Cobrand/UK.pm
+++ b/perllib/FixMyStreet/Cobrand/UK.pm
@@ -5,6 +5,7 @@ use strict;
use JSON::MaybeXS;
use mySociety::MaPit;
use mySociety::VotingArea;
+use Utils;
sub country { return 'GB'; }
sub area_types { [ 'DIS', 'LBO', 'MTD', 'UTA', 'CTY', 'COI', 'LGD' ] }
@@ -122,7 +123,8 @@ sub find_closest {
my $data = $self->SUPER::find_closest($problem, $as_data);
my $mapit_url = FixMyStreet->config('MAPIT_URL');
- my $url = $mapit_url . "nearest/4326/" . $problem->longitude . ',' . $problem->latitude;
+ my ($lat, $lon) = map { Utils::truncate_coordinate($_) } $problem->latitude, $problem->longitude;
+ my $url = $mapit_url . "nearest/4326/$lon,$lat";
my $j = LWP::Simple::get($url);
if ($j) {
$j = JSON->new->utf8->allow_nonref->decode($j);