aboutsummaryrefslogtreecommitdiff
path: root/IkiWiki/Plugin
diff options
context:
space:
mode:
Diffstat (limited to 'IkiWiki/Plugin')
-rw-r--r--IkiWiki/Plugin/osm.pm11
1 files changed, 10 insertions, 1 deletions
diff --git a/IkiWiki/Plugin/osm.pm b/IkiWiki/Plugin/osm.pm
index c9650d014..aa117bae2 100644
--- a/IkiWiki/Plugin/osm.pm
+++ b/IkiWiki/Plugin/osm.pm
@@ -138,6 +138,15 @@ sub preprocess {
);
}
+ # Default to just the OSM layer
+ my @layers = [ 'OSM' ];
+
+ # If the user has passed some layers in
+ if (defined $params{layers}) {
+ # Seperate the layers
+ @layers = [ split(/,/, $params{layers}) ];
+ }
+
register_rendered_files($map, $page, $dest);
$pagestate{$page}{'osm'}{$map}{'displays'}{$name} = {
@@ -150,6 +159,7 @@ sub preprocess {
lat => $lat,
lon => $lon,
href => $href,
+ layers => @layers,
google_apikey => $config{'osm_google_apikey'},
};
return "<div id=\"mapdiv-$name\"></div>";
@@ -587,7 +597,6 @@ sub map_setup_code($;@) {
if ($mapurl) {
$options{'mapurl'} = $mapurl;
}
- $options{'layers'} = $config{osm_layers};
return "mapsetup('mapdiv-$name', " . to_json(\%options) . ");";
}