diff options
author | Struan Donald <struan@exo.org.uk> | 2011-07-26 16:57:08 +0100 |
---|---|---|
committer | Struan Donald <struan@exo.org.uk> | 2011-07-26 16:57:08 +0100 |
commit | 54066cd1387643dd6c6cb3040c520bee66881fd7 (patch) | |
tree | eda84b3f347220ed12de3aa690116148287891bd /perllib/FixMyStreet/Map.pm | |
parent | 8146bad18eeaab658871dd28eb38199a5d068395 (diff) | |
parent | 198fcef62892fe0b2fbb3ea8a080fca87843445e (diff) |
Merge branch 'master' of ssh://git.mysociety.org/data/git/public/fixmystreet into new_statuses
Conflicts:
perllib/FixMyStreet/App/Controller/Admin.pm
perllib/FixMyStreet/App/Controller/JSON.pm
perllib/FixMyStreet/Map/Tilma/Original.pm
web/css/core.css
Diffstat (limited to 'perllib/FixMyStreet/Map.pm')
-rw-r--r-- | perllib/FixMyStreet/Map.pm | 15 |
1 files changed, 13 insertions, 2 deletions
diff --git a/perllib/FixMyStreet/Map.pm b/perllib/FixMyStreet/Map.pm index 6b5a811a6..825e1cd19 100644 --- a/perllib/FixMyStreet/Map.pm +++ b/perllib/FixMyStreet/Map.pm @@ -13,7 +13,6 @@ use strict; use Module::Pluggable sub_name => 'maps', search_path => __PACKAGE__, - except => 'FixMyStreet::Map::Tilma::Original', require => 1; # Get the list of maps we want and load map classes at compile time @@ -23,6 +22,7 @@ use mySociety::Config; use mySociety::Gaze; use mySociety::Locale; use mySociety::Web qw(ent); +use Utils; =head2 allowed_maps @@ -124,8 +124,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; |