aboutsummaryrefslogtreecommitdiffstats
path: root/perllib/FixMyStreet/Map/FMS.pm
diff options
context:
space:
mode:
authorMatthew Somerville <matthew@mysociety.org>2014-10-06 15:47:21 +0000
committerMatthew Somerville <matthew@mysociety.org>2015-02-23 17:10:05 +0000
commit032db2fbb6bd2bf0cf0cf2daa379610ab319a6a8 (patch)
tree7c23e16a551d80ebc2b3ebf05cbc5dac16e1be6e /perllib/FixMyStreet/Map/FMS.pm
parentc763a5e8e78849d736f9c0cec92ee2687ac9e75d (diff)
Support Stamen toner-lite and Bing Maps tiles.
Diffstat (limited to 'perllib/FixMyStreet/Map/FMS.pm')
-rw-r--r--perllib/FixMyStreet/Map/FMS.pm38
1 files changed, 7 insertions, 31 deletions
diff --git a/perllib/FixMyStreet/Map/FMS.pm b/perllib/FixMyStreet/Map/FMS.pm
index 96e265a4d..7e61f334c 100644
--- a/perllib/FixMyStreet/Map/FMS.pm
+++ b/perllib/FixMyStreet/Map/FMS.pm
@@ -5,35 +5,11 @@
# Email: matthew@mysociety.org; WWW: http://www.mysociety.org/
package FixMyStreet::Map::FMS;
-use base 'FixMyStreet::Map::OSM';
+use base 'FixMyStreet::Map::Bing';
use strict;
-# Is set by the JavaScript
-sub map_type {
- return '""';
-}
-
-sub map_template {
- return 'fms';
-}
-
-sub copyright {
- return '';
-}
-
-sub get_quadkey {
- my ($x, $y, $z) = @_;
- my $key = '';
- for (my $i = $z; $i > 0; $i--) {
- my $digit = 0;
- my $mask = 1 << ($i - 1);
- $digit++ if ($x & $mask) != 0;
- $digit += 2 if ($y & $mask) != 0;
- $key .= $digit;
- }
- return $key;
-}
+sub map_template { 'fms' }
sub map_tile_base {
'-', "//%stilma.mysociety.org/sv/%d/%d/%d.png";
@@ -52,13 +28,13 @@ sub map_tiles {
sprintf($tile_base, '', $z, $x, $y),
];
} else {
- my $url = "g=701";
+ my $url = "g=3293";
$url .= "&productSet=mmOS" if $z > 10 && !$ni;
return [
- "//ecn.t0.tiles.virtualearth.net/tiles/r" . get_quadkey($x-1, $y-1, $z) . ".png?$url",
- "//ecn.t1.tiles.virtualearth.net/tiles/r" . get_quadkey($x, $y-1, $z) . ".png?$url",
- "//ecn.t2.tiles.virtualearth.net/tiles/r" . get_quadkey($x-1, $y, $z) . ".png?$url",
- "//ecn.t3.tiles.virtualearth.net/tiles/r" . get_quadkey($x, $y, $z) . ".png?$url",
+ "//ecn.t0.tiles.virtualearth.net/tiles/r" . $self->get_quadkey($x-1, $y-1, $z) . ".png?$url",
+ "//ecn.t1.tiles.virtualearth.net/tiles/r" . $self->get_quadkey($x, $y-1, $z) . ".png?$url",
+ "//ecn.t2.tiles.virtualearth.net/tiles/r" . $self->get_quadkey($x-1, $y, $z) . ".png?$url",
+ "//ecn.t3.tiles.virtualearth.net/tiles/r" . $self->get_quadkey($x, $y, $z) . ".png?$url",
];
}
}