use event-based checkResize not only for invisible layers, but also for layers that have not finished loading. r=pgiraud (pullup #2075)
git-svn-id: http://svn.openlayers.org/trunk/openlayers@9362 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
This commit is contained in:
@@ -212,14 +212,14 @@ OpenLayers.Layer.Google = OpenLayers.Class(
|
||||
* evt - {Event}
|
||||
*/
|
||||
onMapResize: function() {
|
||||
if(this.visibility) {
|
||||
// workaround for resizing of invisible or not yet fully loaded layers
|
||||
// where GMap2.checkResize() does not work. We need to load all tiles
|
||||
// for the old div size, then checkResize(), and then call
|
||||
// layer.moveTo() to trigger GMap.setCenter() (which will finish
|
||||
// the GMap initialization).
|
||||
if(this.visibility && this.mapObject.isLoaded()) {
|
||||
this.mapObject.checkResize();
|
||||
} else {
|
||||
// workaround for resizing of invisible layers where
|
||||
// GMap2.checkResize() does not work. We need to load all tiles
|
||||
// for the old div size, then checkResize(), and then call
|
||||
// layer.moveTo() to trigger GMap.setCenter() (which will finish
|
||||
// the GMap initialization).
|
||||
if(!this._resized) {
|
||||
var layer = this;
|
||||
var handle = GEvent.addListener(this.mapObject, "tilesloaded", function() {
|
||||
|
||||
Reference in New Issue
Block a user