diff options
author | Geneviève Bastien <gbastien@versatic.net> | 2012-08-06 23:00:31 -0400 |
---|---|---|
committer | Antoine Beaupré <anarcat@koumbit.org> | 2012-08-25 08:20:30 -0400 |
commit | 8fb42f42f495095ca32a569401df21f089f0e40c (patch) | |
tree | d6ce8f56ffe12e651052f25d480c517c241b688e /IkiWiki | |
parent | b46e0579328bcc228936397d52dcc88710f95125 (diff) | |
download | ikiwiki-8fb42f42f495095ca32a569401df21f089f0e40c.tar ikiwiki-8fb42f42f495095ca32a569401df21f089f0e40c.tar.gz |
OSM plugin: new config option to specify the url to fetch maps from
Diffstat (limited to 'IkiWiki')
-rw-r--r-- | IkiWiki/Plugin/osm.pm | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/IkiWiki/Plugin/osm.pm b/IkiWiki/Plugin/osm.pm index 764767525..21d1dce3f 100644 --- a/IkiWiki/Plugin/osm.pm +++ b/IkiWiki/Plugin/osm.pm @@ -67,6 +67,13 @@ sub getsetup () { safe => 0, rebuild => 1, }, + osm_map_url => { + type => "string", + example => "/tiles/\${z}/\${x}/\${y}.png", + description => "Url to get map tiles from (if none specified, uses the openstreetmap server, see http://wiki.openstreetmap.org/wiki/Creating_your_own_tiles for more info on serving your own tiles)", + safe => 0, + rebuild => 1, + }, } @@ -540,6 +547,8 @@ sub map_setup_code($;@) { my $name=shift; my %options=@_; + my $mapurl = $config{osm_map_url}; + eval q{use JSON}; error $@ if $@; @@ -556,6 +565,10 @@ sub map_setup_code($;@) { $options{'kmlurl'} = urlto($map."/pois.kml"); } + if ($mapurl) { + $options{'mapurl'} = $mapurl; + } + return "mapsetup('mapdiv-$name', " . to_json(\%options) . ");"; } |