]> sipb.mit.edu Git - ikiwiki.git/blobdiff - IkiWiki/Plugin/osm.pm
fix waypoint hrefs
[ikiwiki.git] / IkiWiki / Plugin / osm.pm
index 661f72bab0ef1a5cc6773b92ae0a37feca4bb4c8..511fe3c9b322d912938b29ee6b9fe946063d2495 100644 (file)
@@ -101,6 +101,14 @@ sub preprocess {
        if ($zoom !~ /^\d\d?$/ || $zoom < 2 || $zoom > 18) {
                error("Bad zoom");
        }
+
+       if (! defined $href || ! length $href) {
+               $href=IkiWiki::cgiurl(
+                       do => "osm",
+                       map => $map,
+               );
+       }
+
        $pagestate{$page}{'osm'}{$map}{'displays'}{$name} = {
                height => $height,
                width => $width,
@@ -183,10 +191,11 @@ sub process_waypoint {
                tag => $tag,
                lat => $lat,
                lon => $lon,
-               # how to link back to the page from the map, not to be
+               # How to link back to the page from the map, not to be
                # confused with the URL of the map itself sent to the
-               # embeded map below
-               href => urlto($page,$map),
+               # embeded map below. Note: used in generated KML etc file,
+               # so must be absolute.
+               href => urlto($page),
        };
        my $output = '';
        if (defined($params{'embed'})) {