[fusion-commits] r2928 - trunk/lib/OpenLayers/ext/OpenLayers/Layer/Google

svn_fusion at osgeo.org svn_fusion at osgeo.org
Mon Apr 18 04:27:09 PDT 2016


Author: jng
Date: 2016-04-18 04:27:09 -0700 (Mon, 18 Apr 2016)
New Revision: 2928

Modified:
   trunk/lib/OpenLayers/ext/OpenLayers/Layer/Google/v3.js
Log:
#639: Fix Google Maps init sequence. This incorporates the following upstream changes from the ol2 github repo:

 - Fix Google layer init sequence (https://github.com/openlayers/ol2/commit/482e61aad4ba758897524f607f7986ece1655327)
 - Fix node not found on Firefox and/or slow connections (https://github.com/openlayers/ol2/commit/7a82b4a1ba8ebcfac912a85418ebaf598d4dac4d)

Modified: trunk/lib/OpenLayers/ext/OpenLayers/Layer/Google/v3.js
===================================================================
--- trunk/lib/OpenLayers/ext/OpenLayers/Layer/Google/v3.js	2016-04-07 07:10:29 UTC (rev 2927)
+++ trunk/lib/OpenLayers/ext/OpenLayers/Layer/Google/v3.js	2016-04-18 11:27:09 UTC (rev 2928)
@@ -152,22 +152,28 @@
             if (visible === true) {
                 if (container.parentNode !== map.div) {
                     if (!cache.rendered) {
+                        container.style.visibility = 'hidden';
                         var me = this;
                         google.maps.event.addListenerOnce(this.mapObject, 'tilesloaded', function() {
                             cache.rendered = true;
-                            me.setGMapVisibility(me.getVisibility());
+                            container.style.visibility = '';
+                            me.setGMapVisibility(true);
                             me.moveTo(me.map.getCenter());
+                            cache.googleControl.appendChild(map.viewPortDiv);
+                            me.setGMapVisibility(me.visible);
                         });
                     } else {
-                        map.div.appendChild(container);
                         cache.googleControl.appendChild(map.viewPortDiv);
-                        google.maps.event.trigger(this.mapObject, 'resize');
                     }
+                    map.div.appendChild(container);
+                    google.maps.event.trigger(this.mapObject, 'resize');
                 }
-                this.mapObject.setMapTypeId(type);                
+                this.mapObject.setMapTypeId(type);
             } else if (cache.googleControl.hasChildNodes()) {
                 map.div.appendChild(map.viewPortDiv);
-                map.div.removeChild(container);
+                if (map.div.contains(container)) {
+                    map.div.removeChild(container);
+                }
             }
         }
     },



More information about the fusion-commits mailing list