aboutsummaryrefslogtreecommitdiffstats
path: root/perllib/FixMyStreet/Map
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
parentc6a20311276f00befd27fe0ea7e606db4a13844d (diff)
Remove unused Tilma, consolidate tile lookup for legacy URLs to work in different map format.
Diffstat (limited to 'perllib/FixMyStreet/Map')
-rw-r--r--perllib/FixMyStreet/Map/Tilma/OL/1_10k.pm28
-rw-r--r--perllib/FixMyStreet/Map/Tilma/OL/StreetView.pm28
-rw-r--r--perllib/FixMyStreet/Map/Tilma/OpenLayers.pm35
-rw-r--r--perllib/FixMyStreet/Map/Tilma/Original.pm33
-rw-r--r--perllib/FixMyStreet/Map/Tilma/Original/1_10k.pm28
-rw-r--r--perllib/FixMyStreet/Map/Tilma/Original/StreetView.pm28
6 files changed, 8 insertions, 172 deletions
diff --git a/perllib/FixMyStreet/Map/Tilma/OL/1_10k.pm b/perllib/FixMyStreet/Map/Tilma/OL/1_10k.pm
deleted file mode 100644
index 34df8dc8b..000000000
--- a/perllib/FixMyStreet/Map/Tilma/OL/1_10k.pm
+++ /dev/null
@@ -1,28 +0,0 @@
-#!/usr/bin/perl
-#
-# FixMyStreet:Map::Tilma::1_10k_OL
-# Using tilma.mysociety.org with OpenLayers
-#
-# Copyright (c) 2010 UK Citizens Online Democracy. All rights reserved.
-# Email: matthew@mysociety.org; WWW: http://www.mysociety.org/
-
-package FixMyStreet::Map::Tilma::OL::1_10k;
-use base 'FixMyStreet::Map::Tilma::OpenLayers';
-
-use strict;
-
-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'; }
-
-sub copyright {
- return _('&copy; Crown copyright. All rights reserved. Ministry of Justice 100037819&nbsp;2008.');
-}
-
-sub watermark {
- return 1;
-}
-
-1;
diff --git a/perllib/FixMyStreet/Map/Tilma/OL/StreetView.pm b/perllib/FixMyStreet/Map/Tilma/OL/StreetView.pm
deleted file mode 100644
index 2a531766c..000000000
--- a/perllib/FixMyStreet/Map/Tilma/OL/StreetView.pm
+++ /dev/null
@@ -1,28 +0,0 @@
-#!/usr/bin/perl
-#
-# FixMyStreet:Map::TilmaXY
-# Using tilma.mysociety.org but accessing images directly.
-#
-# Copyright (c) 2010 UK Citizens Online Democracy. All rights reserved.
-# Email: matthew@mysociety.org; WWW: http://www.mysociety.org/
-
-package FixMyStreet::Map::Tilma::OL::StreetView;
-use base 'FixMyStreet::Map::Tilma::OpenLayers';
-
-use strict;
-
-sub tile_width { return 250; }
-sub tif_size_m { return 5000; }
-sub tif_size_px { return 5000; }
-sub scale_factor { return tif_size_m() / (tif_size_px() / tile_width()); }
-sub tile_type { return 'streetview'; }
-
-sub copyright {
- return _('Map contains Ordnance Survey data &copy; Crown copyright and database right 2010.');
-}
-
-sub watermark {
- return 0;
-}
-
-1;
diff --git a/perllib/FixMyStreet/Map/Tilma/OpenLayers.pm b/perllib/FixMyStreet/Map/Tilma/OpenLayers.pm
deleted file mode 100644
index 31e9eb096..000000000
--- a/perllib/FixMyStreet/Map/Tilma/OpenLayers.pm
+++ /dev/null
@@ -1,35 +0,0 @@
-#!/usr/bin/perl
-#
-# FixMyStreet:Map::Tilma::1_10k_OL
-# Using tilma.mysociety.org with OpenLayers
-#
-# Copyright (c) 2010 UK Citizens Online Democracy. All rights reserved.
-# Email: matthew@mysociety.org; WWW: http://www.mysociety.org/
-
-package FixMyStreet::Map::Tilma::OpenLayers;
-
-use strict;
-
-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; }
-
-# display_map C PARAMS
-# PARAMS include:
-# latitude, longitude for the centre point of the map
-# TYPE is 1 if the map is clickable, 0 otherwise.
-# PINS is array of pins to show, location and colour
-sub display_map {
- my ($self, $c, %params) = @_;
- $c->stash->{map} = {
- %params,
- type => 'tilma/openlayers',
- tile_type => TILE_TYPE,
- tilewidth => TILE_WIDTH,
- watermark => $self->watermark(),
- copyright => $self->copyright(),
- maxResolution => SCALE_FACTOR / TILE_WIDTH,
- };
-}
-
-1;
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;
diff --git a/perllib/FixMyStreet/Map/Tilma/Original/1_10k.pm b/perllib/FixMyStreet/Map/Tilma/Original/1_10k.pm
deleted file mode 100644
index 722df2a46..000000000
--- a/perllib/FixMyStreet/Map/Tilma/Original/1_10k.pm
+++ /dev/null
@@ -1,28 +0,0 @@
-#!/usr/bin/perl
-#
-# FixMyStreet:Map
-# Adding the ability to have different maps on FixMyStreet.
-#
-# Copyright (c) 2010 UK Citizens Online Democracy. All rights reserved.
-# Email: matthew@mysociety.org; WWW: http://www.mysociety.org/
-
-package FixMyStreet::Map::Tilma::Original::1_10k;
-use base 'FixMyStreet::Map::Tilma::Original';
-
-use strict;
-
-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'; }
-
-sub copyright {
- return _('&copy; Crown copyright. All rights reserved. Ministry of Justice 100037819&nbsp;2008.');
-}
-
-sub watermark {
- return 1;
-}
-
-1;
diff --git a/perllib/FixMyStreet/Map/Tilma/Original/StreetView.pm b/perllib/FixMyStreet/Map/Tilma/Original/StreetView.pm
deleted file mode 100644
index fe03fdb00..000000000
--- a/perllib/FixMyStreet/Map/Tilma/Original/StreetView.pm
+++ /dev/null
@@ -1,28 +0,0 @@
-#!/usr/bin/perl
-#
-# FixMyStreet:Map
-# Adding the ability to have different maps on FixMyStreet.
-#
-# Copyright (c) 2010 UK Citizens Online Democracy. All rights reserved.
-# Email: matthew@mysociety.org; WWW: http://www.mysociety.org/
-
-package FixMyStreet::Map::Tilma::Original::StreetView;
-use base 'FixMyStreet::Map::Tilma::Original';
-
-use strict;
-
-sub tile_width { return 250; }
-sub tif_size_m { return 5000; }
-sub tif_size_px { return 5000; }
-sub scale_factor { return tif_size_m() / (tif_size_px() / tile_width()); }
-sub tile_type { return 'streetview'; }
-
-sub copyright {
- return _('Map contains Ordnance Survey data &copy; Crown copyright and database right 2010.');
-}
-
-sub watermark {
- return 0;
-}
-
-1;