aboutsummaryrefslogtreecommitdiffstats
path: root/perllib/FixMyStreet/Map.pm
diff options
context:
space:
mode:
authorMatthew Somerville <matthew@mysociety.org>2011-07-01 12:44:59 +0100
committerMatthew Somerville <matthew@mysociety.org>2011-07-01 12:45:22 +0100
commitd1d67bd600324ac30ce7fb640c81b4b9d09254a8 (patch)
tree1a8d7b49907b180951c06e0d3b8b5270c9b4d490 /perllib/FixMyStreet/Map.pm
parentc6a20311276f00befd27fe0ea7e606db4a13844d (diff)
Remove unused Tilma, consolidate tile lookup for legacy URLs to work in different map format.
Diffstat (limited to 'perllib/FixMyStreet/Map.pm')
-rw-r--r--perllib/FixMyStreet/Map.pm14
1 files changed, 13 insertions, 1 deletions
diff --git a/perllib/FixMyStreet/Map.pm b/perllib/FixMyStreet/Map.pm
index 6b5a811a6..20f18a547 100644
--- a/perllib/FixMyStreet/Map.pm
+++ b/perllib/FixMyStreet/Map.pm
@@ -23,6 +23,7 @@ use mySociety::Config;
use mySociety::Gaze;
use mySociety::Locale;
use mySociety::Web qw(ent);
+use Utils;
=head2 allowed_maps
@@ -124,8 +125,19 @@ sub click_to_wgs84 {
return $map_class->click_to_wgs84(@_);
}
+=head2 tile_xy_to_wgs84
+
+Takes the tile x,y and converts to lat, lon. Legacy to deal with old URLs,
+hence hard-coded things.
+
+=cut
+
sub tile_xy_to_wgs84 {
- return $map_class->tile_xy_to_wgs84(@_);
+ my ( $x, $y ) = @_;
+ my $easting = int( $x * (5000/31) + 0.5 );
+ my $northing = int( $y * (5000/31) + 0.5 );
+ my ( $lat, $lon ) = Utils::convert_en_to_latlon( $easting, $northing );
+ return ( $lat, $lon );
}
1;