aboutsummaryrefslogtreecommitdiff
path: root/IkiWiki
diff options
context:
space:
mode:
authorGenevieve <gbastien@versatic.net>2012-08-02 21:10:42 -0400
committerJoey Hess <joey@kitenet.net>2012-08-05 22:02:01 -0400
commit409c4e48f983d10aceb6321148d7f440d17eb28f (patch)
treee3ac87f140eb68f98cc075d64d97970c987a540a /IkiWiki
parent60ef4b19657fb46492135b342a34435b891a80ef (diff)
downloadikiwiki-409c4e48f983d10aceb6321148d7f440d17eb28f.tar
ikiwiki-409c4e48f983d10aceb6321148d7f440d17eb28f.tar.gz
OSM Plugin: Possibility to configure where the OpenLayers.js file is
(cherry picked from commit 6f684cd412e6d93f943c1fa5d8dac91caa138be0)
Diffstat (limited to 'IkiWiki')
-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 e96a12837..6ba2524d8 100644
--- a/IkiWiki/Plugin/osm.pm
+++ b/IkiWiki/Plugin/osm.pm
@@ -60,6 +60,14 @@ sub getsetup () {
safe => 0,
rebuild => 1,
},
+ osm_openlayers_url => {
+ type => "string",
+ example => "http://www.openlayers.org/api/OpenLayers.js",
+ description => "Url for the OpenLayers.js file",
+ safe => 0,
+ rebuild => 1,
+ },
+
}
sub register_rendered_files {
@@ -519,7 +527,8 @@ sub cgi($) {
sub embed_map_code(;$) {
my $page=shift;
- return '<script src="http://www.openlayers.org/api/OpenLayers.js" type="text/javascript" charset="utf-8"></script>'.
+ my $olurl = $config{osm_openlayers_url} || "http://www.openlayers.org/api/OpenLayers.js";
+ return '<script src="'.$olurl.'" type="text/javascript" charset="utf-8"></script>'.
'<script src="'.urlto("ikiwiki/osm.js", $page).
'" type="text/javascript" charset="utf-8"></script>'."\n";
}