From 553f05d2931b4a8481d66e27bb875b78ef511a59 Mon Sep 17 00:00:00 2001 From: ahocevar Date: Fri, 29 May 2009 07:59:10 +0000 Subject: [PATCH] Another fix for the problem with resized Google layers that were previously invisible. Has the GMaps API changed in the meantime? At least this fix (listening for the "load" event) feels like it makes more sense than the previous one (listening for the "tilesloaded" event). r=pgiraud (closes #1797) git-svn-id: http://svn.openlayers.org/trunk/openlayers@9418 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf --- lib/OpenLayers/Layer/Google.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/OpenLayers/Layer/Google.js b/lib/OpenLayers/Layer/Google.js index f48c3f42ae..756576cafb 100644 --- a/lib/OpenLayers/Layer/Google.js +++ b/lib/OpenLayers/Layer/Google.js @@ -213,7 +213,7 @@ OpenLayers.Layer.Google = OpenLayers.Class( */ onMapResize: function() { // workaround for resizing of invisible or not yet fully loaded layers - // where GMap2.checkResize() does not work. We need to load all tiles + // where GMap2.checkResize() does not work. We need to load the GMap // for the old div size, then checkResize(), and then call // layer.moveTo() to trigger GMap.setCenter() (which will finish // the GMap initialization). @@ -222,7 +222,7 @@ OpenLayers.Layer.Google = OpenLayers.Class( } else { if(!this._resized) { var layer = this; - var handle = GEvent.addListener(this.mapObject, "tilesloaded", function() { + var handle = GEvent.addListener(this.mapObject, "load", function() { GEvent.removeListener(handle); delete layer._resized; layer.mapObject.checkResize();