OSM Plugin: Possibility to configure where the OpenLayers.js file is

(cherry picked from commit 6f684cd412e6d93f943c1fa5d8dac91caa138be0)
master
Genevieve 2012-08-02 21:10:42 -04:00 committed by Joey Hess
parent 60ef4b1965
commit 409c4e48f9
1 changed files with 10 additions and 1 deletions

View File

@ -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";
}