]> git.vanrenterghem.biz Git - git.ikiwiki.info.git/commitdiff
fix href parameter for osm
authorJoey Hess <joey@kitenet.net>
Sun, 18 Mar 2012 21:39:06 +0000 (17:39 -0400)
committerJoey Hess <joey@kitenet.net>
Sun, 18 Mar 2012 21:39:06 +0000 (17:39 -0400)
This was not set anywhere, which causes their javascript to crash.
It *seems* the idea is this is the url to use to view the map full screen,
which uses ikiwiki.cgi.

IkiWiki/Plugin/osm.pm

index 661f72bab0ef1a5cc6773b92ae0a37feca4bb4c8..ef6bc5b11d313940ddee503d047594da39b1c1a7 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,