From: Christopher De Cairos Date: Tue, 23 Aug 2011 14:35:33 +0000 (-0400) Subject: moved getScript call to _setup, which will stop openlayers.js from loading, unless... X-Git-Tag: v0.8^2~10^2~1 X-Git-Url: http://git.khamidou.com/?a=commitdiff_plain;h=d1a4bb043d769d348ffc1bb991e0a7d67e3445aa;p=popcorn-js.git moved getScript call to _setup, which will stop openlayers.js from loading, unless the open map plugin is used. --- diff --git a/plugins/openmap/popcorn.openmap.js b/plugins/openmap/popcorn.openmap.js index 4a782e4..ce6a4b6 100755 --- a/plugins/openmap/popcorn.openmap.js +++ b/plugins/openmap/popcorn.openmap.js @@ -38,11 +38,6 @@ var newdiv, i = 1; - // insert openlayers api script once - if ( !window.OpenLayers ) { - Popcorn.getScript( "http://openlayers.org/api/OpenLayers.js", function() {}); - } - function toggle( container, display ) { if ( container.map ) { @@ -140,6 +135,11 @@ */ _setup: function( options ) { + // insert openlayers api script once + if ( !window.OpenLayers ) { + Popcorn.getScript( "http://openlayers.org/api/OpenLayers.js", function() {}); + } + var isReady = function() { // wait until OpenLayers has been loaded, and the start function is run, before adding map if ( !options.map ) {