diff --git a/lib/OpenLayers/Layer/Google.js b/lib/OpenLayers/Layer/Google.js index 9cbfde938e..3fc0c0a590 100644 --- a/lib/OpenLayers/Layer/Google.js +++ b/lib/OpenLayers/Layer/Google.js @@ -189,7 +189,26 @@ OpenLayers.Layer.Google = OpenLayers.Class( * evt - {Event} */ onMapResize: function() { - this.mapObject.checkResize(); + if(this.visibility) { + this.mapObject.checkResize(); + } else { + this.windowResized = true; + } + }, + + /** + * Method: display + * Hide or show the layer + * + * Parameters: + * display - {Boolean} + */ + display: function(display) { + OpenLayers.Layer.EventPane.prototype.display.apply(this, arguments); + if(this.div.style.display == "block" && this.windowResized) { + this.mapObject.checkResize(); + this.windowResized = false; + } }, /**