fix for dynamic resizing
git-svn-id: http://svn.openlayers.org/trunk/openlayers@1487 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
This commit is contained in:
@@ -476,16 +476,19 @@ OpenLayers.Map.prototype = {
|
|||||||
this.layers[i].onMapResize();
|
this.layers[i].onMapResize();
|
||||||
}
|
}
|
||||||
|
|
||||||
var center = new OpenLayers.Pixel(newSize.w /2, newSize.h / 2);
|
|
||||||
|
|
||||||
var zoom = this.getZoom();
|
|
||||||
this.zoom = null;
|
|
||||||
this.setCenter(center, zoom);
|
|
||||||
|
|
||||||
// store the new size
|
// store the new size
|
||||||
this.size = newSize;
|
this.size = newSize;
|
||||||
// the div might have moved on the page, also
|
// the div might have moved on the page, also
|
||||||
this.events.element.offsets = null;
|
this.events.element.offsets = null;
|
||||||
|
|
||||||
|
if (this.baseLayer != null) {
|
||||||
|
var center = new OpenLayers.Pixel(newSize.w /2, newSize.h / 2);
|
||||||
|
var centerLL = this.getLonLatFromViewPortPx(center);
|
||||||
|
var zoom = this.getZoom();
|
||||||
|
this.zoom = null;
|
||||||
|
this.setCenter(this.getCenter(), zoom);
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user