[OpenLayers-Commits] r11989 - sandbox/ahocevar/google-ng/lib/OpenLayers/Layer

commits-20090109 at openlayers.org commits-20090109 at openlayers.org
Sun May 22 18:04:33 EDT 2011


Author: ahocevar
Date: 2011-05-22 15:04:32 -0700 (Sun, 22 May 2011)
New Revision: 11989

Modified:
   sandbox/ahocevar/google-ng/lib/OpenLayers/Layer/GoogleNG.js
Log:
handle the case where mapType is already available

Modified: sandbox/ahocevar/google-ng/lib/OpenLayers/Layer/GoogleNG.js
===================================================================
--- sandbox/ahocevar/google-ng/lib/OpenLayers/Layer/GoogleNG.js	2011-05-22 20:14:29 UTC (rev 11988)
+++ sandbox/ahocevar/google-ng/lib/OpenLayers/Layer/GoogleNG.js	2011-05-22 22:04:32 UTC (rev 11989)
@@ -92,11 +92,15 @@
             OpenLayers.Layer.GoogleNG.prototype.mapObject =
                 new google.maps.Map(document.createElement("div"));
         }
-        google.maps.event.addListenerOnce(
-            this.mapObject, 
-            "idle", 
-            OpenLayers.Function.bind(this.initLayer, this)
-        );
+        if (this.mapObject.mapTypes[this.type]) {
+            this.initLayer();
+        } else {
+            google.maps.event.addListenerOnce(
+                this.mapObject, 
+                "idle", 
+                OpenLayers.Function.bind(this.initLayer, this)
+            );
+        }
 
         options = OpenLayers.Util.applyDefaults({
             sphericalMercator: true



More information about the Commits mailing list