X-Git-Url: http://git.vanrenterghem.biz/git.ikiwiki.info.git/blobdiff_plain/a12dc958839ee684fc5755c371a9b3c5a917e88c..037a24d73f29b59c3653f1dee19e6ae70cb2c58f:/IkiWiki/Plugin/osm.pm?ds=sidebyside diff --git a/IkiWiki/Plugin/osm.pm b/IkiWiki/Plugin/osm.pm index 466006cbf..a5af4ed21 100644 --- a/IkiWiki/Plugin/osm.pm +++ b/IkiWiki/Plugin/osm.pm @@ -14,7 +14,7 @@ sub import { hook(type => "format", id => "osm", call => \&format); hook(type => "preprocess", id => "osm", call => \&preprocess); hook(type => "preprocess", id => "waypoint", call => \&process_waypoint); - hook(type => "savestate", id => "waypoint", call => \&savestate); + hook(type => "changes", id => "waypoint", call => \&changes); hook(type => "cgi", id => "osm", call => \&cgi); } @@ -192,6 +192,7 @@ sub process_waypoint { } } $icon = urlto($icon, $dest, 1); + $icon =~ s!/*$!!; # hack - urlto shouldn't be appending a slash in the first place $tag = '' unless $tag; register_rendered_files($map, $page, $dest); $pagestate{$page}{'osm'}{$map}{'waypoints'}{$name} = { @@ -279,7 +280,7 @@ sub scrub_lonlat($$$) { return ($lon, $lat); } -sub savestate { +sub changes { my %waypoints = (); my %linestrings = (); @@ -359,7 +360,7 @@ sub writekml($;$) { foreach my $map (keys %waypoints) { my $output; my $writer = XML::Writer->new( OUTPUT => \$output, - DATA_MODE => 1, ENCODING => 'UTF-8'); + DATA_MODE => 1, DATA_INDENT => ' ', ENCODING => 'UTF-8'); $writer->xmlDecl(); $writer->startTag("kml", "xmlns" => "http://www.opengis.net/kml/2.2"); $writer->startTag("Document"); @@ -506,7 +507,7 @@ sub include_javascript ($) { } } if ($loader) { - return embed_map_code($page) . ""; + return embed_map_code($page) . ""; } else { return ''; @@ -533,7 +534,7 @@ sub cgi($) { print ""; print "
"; print embed_map_code(); - print "