1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20
|
Description: OSM has changed their short copyable URLs
Origin: vendor
Bug: https://rt.cpan.org/Ticket/Display.html?id=94148
Forwarded: https://rt.cpan.org/Ticket/Display.html?id=94148
Author: gregor herrmann <gregoa@debian.org>
Last-Update: 2014-08-14
--- a/downloadosmtiles.pl
+++ b/downloadosmtiles.pl
@@ -98,6 +98,10 @@
sub selecttilescmdline
{
if ($opt{link}) {
+ # rewrite new style OSM links to old pattern
+ if ($opt{link} =~ /^http:\/\/(.+)\/#map=(\d+)\/(-?[\d.]+)\/(-?[\d.]+)/) {
+ $opt{link} = "http://$1/?lat=$3&lon=$4&zoom=$2&layers=M";
+ }
die "Invalid link: $opt{link}\n"
unless $opt{link} =~ /^http:\/\/.*\/\?lat=(-?\d+(?:\.\d+)?)\&lon=(-?\d+(?:\.\d+)?)\&zoom=(\d+)/;
my $lat = $1;
|