diff options
-rw-r--r-- | perllib/Page.pm | 1 | ||||
-rwxr-xr-x | web/index.cgi | 9 |
2 files changed, 6 insertions, 4 deletions
diff --git a/perllib/Page.pm b/perllib/Page.pm index ffe16fb9a..0aa06102d 100644 --- a/perllib/Page.pm +++ b/perllib/Page.pm @@ -672,6 +672,7 @@ sub mapit_check_error { return _('That postcode was not recognised, sorry.') if $location->{code} =~ /^4/; return $location->{error}; } + return if mySociety::Config::get('COUNTRY') eq 'NO'; my $island = $location->{coordsyst}; if (!$island) { return _("Sorry, that appears to be a Crown dependency postcode, which we don't cover."); diff --git a/web/index.cgi b/web/index.cgi index f8f119f54..e40987ec1 100755 --- a/web/index.cgi +++ b/web/index.cgi @@ -503,8 +503,6 @@ sub display_form { # Map was clicked on (tilma, or non-JS OpenLayers, for example) ($latitude, $longitude) = FixMyStreet::Map::click_to_wgs84($q, $pin_tile_x, $pin_x, $pin_tile_y, $pin_y); - # Shrink, as don't need accuracy plus we want them as English strings - ($latitude, $longitude) = map { Utils::truncate_coordinate($_) } ( $latitude, $longitude ); } elsif ( $input{partial} && $input{pc} && !length $input{latitude} && !length $input{longitude} ) { my $error; @@ -521,6 +519,9 @@ sub display_form { $longitude = $input_h{longitude}; } + # Shrink, as don't need accuracy plus we want them as English strings + ($latitude, $longitude) = map { Utils::truncate_coordinate($_) } ( $latitude, $longitude ); + # Look up councils and do checks for the point we've got my @area_types = Cobrand::area_types($cobrand); # XXX: I think we want in_gb_locale around the next line, needs testing @@ -938,7 +939,7 @@ sub display_location { $map_links .= "</p>"; } - # truncate the lat,lon for nicer rss urls + # truncate the lat,lon for nicer rss urls, and strings for outputting my ( $short_lat, $short_lon ) = map { Utils::truncate_coordinate($_) } # ( $latitude, $longitude ); @@ -963,7 +964,7 @@ sub display_location { my %vars = ( 'map' => FixMyStreet::Map::display_map($q, - latitude => $latitude, longitude => $longitude, + latitude => $short_lat, longitude => $short_lon, type => 1, pins => \@pins, post => $map_links |