diff options
author | Matthew Somerville <matthew@mysociety.org> | 2015-01-22 15:57:45 +0000 |
---|---|---|
committer | Matthew Somerville <matthew-github@dracos.co.uk> | 2015-02-13 11:44:07 +0000 |
commit | da63f72c27e16d491f9103b9a8cbdb2fd96d2b59 (patch) | |
tree | cfd6df35b4c41028943d8a1e669345b81be41913 /perllib/FixMyStreet/App/Controller/Council.pm | |
parent | 04117b8be30b5d82d50cdc047ac4e7c19864f8ed (diff) |
Make sure all co-ordinates are stringified.
This includes MapIt postcode lookups, geocoding, query parameters, tile
clicks. Stringifying truncates them to six decimal places, which means
we no longer need any "short" versions anywhere, and the JSON response
will always uses a decimal point regardless of locale.
Diffstat (limited to 'perllib/FixMyStreet/App/Controller/Council.pm')
-rw-r--r-- | perllib/FixMyStreet/App/Controller/Council.pm | 7 |
1 files changed, 2 insertions, 5 deletions
diff --git a/perllib/FixMyStreet/App/Controller/Council.pm b/perllib/FixMyStreet/App/Controller/Council.pm index 8a174c254..a5915aa46 100644 --- a/perllib/FixMyStreet/App/Controller/Council.pm +++ b/perllib/FixMyStreet/App/Controller/Council.pm @@ -49,9 +49,6 @@ sub load_and_check_areas : Private { $area_types = $c->cobrand->area_types; } - my $short_latitude = Utils::truncate_coordinate($latitude); - my $short_longitude = Utils::truncate_coordinate($longitude); - my $all_areas; my %params; @@ -62,7 +59,7 @@ sub load_and_check_areas : Private { my %area_types = map { $_ => 1 } @$area_types; $all_areas = mySociety::MaPit::call( 'point', - "4326/$short_longitude,$short_latitude", %params ); + "4326/$longitude,$latitude", %params ); $c->stash->{all_areas_mapit} = $all_areas; $all_areas = { map { $_ => $all_areas->{$_} } @@ -72,7 +69,7 @@ sub load_and_check_areas : Private { } else { $all_areas = mySociety::MaPit::call( 'point', - "4326/$short_longitude,$short_latitude", %params, + "4326/$longitude,$latitude", %params, type => $area_types ); } if ($all_areas->{error}) { |