aboutsummaryrefslogtreecommitdiffstats
path: root/perllib/FixMyStreet/Map/Tilma/Original.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/Tilma/Original.pm
parentc6a20311276f00befd27fe0ea7e606db4a13844d (diff)
Remove unused Tilma, consolidate tile lookup for legacy URLs to work in different map format.
Diffstat (limited to 'perllib/FixMyStreet/Map/Tilma/Original.pm')
-rw-r--r--perllib/FixMyStreet/Map/Tilma/Original.pm33
1 files changed, 8 insertions, 25 deletions
diff --git a/perllib/FixMyStreet/Map/Tilma/Original.pm b/perllib/FixMyStreet/Map/Tilma/Original.pm
index 0baa82011..08260708c 100644
--- a/perllib/FixMyStreet/Map/Tilma/Original.pm
+++ b/perllib/FixMyStreet/Map/Tilma/Original.pm
@@ -8,6 +8,12 @@
package FixMyStreet::Map::Tilma::Original;
+sub TILE_WIDTH { return 254; }
+sub TIF_SIZE_M { return 5000; }
+sub TIF_SIZE_PX { return 7874; }
+sub SCALE_FACTOR { return TIF_SIZE_M() / (TIF_SIZE_PX() / TILE_WIDTH()); }
+sub TILE_TYPE { return '10k-full'; }
+
use strict;
use LWP::Simple;
@@ -17,10 +23,6 @@ use mySociety::Web qw(ent NewURL);
use Utils;
use RABX;
-sub TILE_WIDTH() { return $FixMyStreet::Map::map_class->tile_width; }
-sub SCALE_FACTOR() { return $FixMyStreet::Map::map_class->scale_factor; }
-sub TILE_TYPE() { return $FixMyStreet::Map::map_class->tile_type; }
-
sub _ll_to_en {
my ($lat, $lon) = @_;
return Utils::convert_latlon_to_en( $lat, $lon );
@@ -76,8 +78,8 @@ sub display_map {
py => $py,
tile_type => TILE_TYPE,
tilewidth => TILE_WIDTH,
- watermark => $self->watermark(),
- copyright => $self->copyright(),
+ watermark => 1,
+ copyright => _('&copy; Crown copyright. All rights reserved. Ministry of Justice 100037819&nbsp;2008.'),
};
}
@@ -163,25 +165,6 @@ sub tile_to_os {
return int($_[0] * SCALE_FACTOR + 0.5);
}
-=head2 tile_xy_to_wgs84
-
- ($lat, $lon) = tile_xy_to_wgs84( $x, $y );
-
-Takes the tile x,y and converts to lat, lon.
-
-=cut
-
-sub tile_xy_to_wgs84 {
- my ( $self, $x, $y ) = @_;
-
- my $easting = tile_to_os($x);
- my $northing = tile_to_os($y);
-
- my ( $lat, $lon ) = Utils::convert_en_to_latlon( $easting, $northing );
- return ( $lat, $lon );
-}
-
-
sub click_to_tile {
my ($pin_tile, $pin, $invert) = @_;
$pin -= TILE_WIDTH while $pin > TILE_WIDTH;