aboutsummaryrefslogtreecommitdiffstats
path: root/perllib/FixMyStreet/Map/FMS.pm
diff options
context:
space:
mode:
authorMatthew Somerville <matthew@mysociety.org>2020-07-09 17:38:00 +0100
committerMatthew Somerville <matthew@mysociety.org>2020-07-10 19:13:29 +0100
commit196e3cafcfcec0cc1a050a9d07aad81156ee794e (patch)
treeb77ed78b82637df17284b9fdd3f5f874e372c0d5 /perllib/FixMyStreet/Map/FMS.pm
parent76b2704d4e9a0b0d2c8af704a68652d7b4d81780 (diff)
Use up-to-date Bing map URLs.
Diffstat (limited to 'perllib/FixMyStreet/Map/FMS.pm')
-rw-r--r--perllib/FixMyStreet/Map/FMS.pm15
1 files changed, 8 insertions, 7 deletions
diff --git a/perllib/FixMyStreet/Map/FMS.pm b/perllib/FixMyStreet/Map/FMS.pm
index 0cb1de553..246d04bc0 100644
--- a/perllib/FixMyStreet/Map/FMS.pm
+++ b/perllib/FixMyStreet/Map/FMS.pm
@@ -32,16 +32,17 @@ sub map_tiles {
sprintf($tile_base, 'c-', $z, $x-1, $y),
sprintf($tile_base, '', $z, $x, $y),
];
- } else {
+ } elsif (!$ni && $z > 11) {
my $key = FixMyStreet->config('BING_MAPS_API_KEY');
- my $url = "g=6570";
- $url .= "&productSet=mmOS&key=$key" if $z > 11 && !$ni;
+ my $base = "//ecn.%s.tiles.virtualearth.net/tiles/r%s?g=8702&lbl=l1&productSet=mmOS&key=$key";
return [
- "//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",
+ sprintf($base, "t0", $self->get_quadkey($x-1, $y-1, $z)),
+ sprintf($base, "t1", $self->get_quadkey($x, $y-1, $z)),
+ sprintf($base, "t2", $self->get_quadkey($x-1, $y, $z)),
+ sprintf($base, "t3", $self->get_quadkey($x, $y, $z)),
];
+ } else {
+ return $self->SUPER::map_tiles(%params);
}
}