make updateSize not call setCenter if map has no center, and remove unused code, r=tschaub (closes #2105) (closes #2114)

git-svn-id: http://svn.openlayers.org/trunk/openlayers@9587 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
This commit is contained in:
Éric Lemoine
2009-07-24 12:49:13 +00:00
parent 1faae2a2a2
commit f7a2efe2bf
2 changed files with 37 additions and 5 deletions

View File

@@ -1343,12 +1343,12 @@ OpenLayers.Map = OpenLayers.Class({
this.layers[i].onMapResize();
}
if (this.baseLayer != null) {
var center = new OpenLayers.Pixel(newSize.w /2, newSize.h / 2);
var centerLL = this.getLonLatFromViewPortPx(center);
var center = this.getCenter();
if (this.baseLayer != null && center != null) {
var zoom = this.getZoom();
this.zoom = null;
this.setCenter(this.getCenter(), zoom);
this.setCenter(center, zoom);
}
}