aboutsummaryrefslogtreecommitdiffstats
path: root/perllib/FixMyStreet/Map/UKCouncilWMTS.pm
diff options
context:
space:
mode:
authorStruan Donald <struan@exo.org.uk>2019-08-30 15:24:33 +0100
committerMatthew Somerville <matthew@mysociety.org>2019-09-13 09:51:21 +0100
commit1331d390ffbd28ec1bf5cbacc408eddef52cddb6 (patch)
tree6445570a9c0ca6fa51d79b5f3dea9e73536c4f63 /perllib/FixMyStreet/Map/UKCouncilWMTS.pm
parent9449e4c6628666a32dce4061b8b43141b93616d5 (diff)
do not reproject uk wmts map if no coordinates
If the coordinates are (0,0) then return that straight back as trying to reproject causes Geography::NationalGrid::GB to fall over as 0 lat is outside UK Fixes #2617
Diffstat (limited to 'perllib/FixMyStreet/Map/UKCouncilWMTS.pm')
-rw-r--r--perllib/FixMyStreet/Map/UKCouncilWMTS.pm2
1 files changed, 2 insertions, 0 deletions
diff --git a/perllib/FixMyStreet/Map/UKCouncilWMTS.pm b/perllib/FixMyStreet/Map/UKCouncilWMTS.pm
index da0720f06..aba6d3840 100644
--- a/perllib/FixMyStreet/Map/UKCouncilWMTS.pm
+++ b/perllib/FixMyStreet/Map/UKCouncilWMTS.pm
@@ -36,6 +36,8 @@ sub tile_parameters {
# Reproject a WGS84 lat/lon into BNG easting/northing
sub reproject_from_latlon($$$) {
my ($self, $lat, $lon) = @_;
+ # do not try to reproject if we have no co-ordindates as convert breaks
+ return (0.0, 0.0) if $lat == 0 && $lon == 0;
my ($x, $y) = Utils::convert_latlon_to_en($lat, $lon);
return ($x, $y);
}