]> khamidou — GitHub mirrors - popcorn-js.git/commitdiff
moved getScript call to _setup, which will stop openlayers.js from loading, unless...
authorChristopher De Cairos <chris.decairos@gmail.com>
Tue, 23 Aug 2011 14:35:33 +0000 (10:35 -0400)
committerChristopher De Cairos <chris.decairos@gmail.com>
Tue, 23 Aug 2011 14:35:33 +0000 (10:35 -0400)
plugins/openmap/popcorn.openmap.js

index 4a782e4a1715ef3c54c5b16a0963c13710a4bcfb..ce6a4b6d6aaac0144188cb661b2da5268e7ffd8c 100755 (executable)
   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 ) {
       
        */
       _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 ) {