Changeset 2167
- Timestamp:
- 01/20/07 12:03:40 (2 years ago)
- Files:
-
- trunk/openlayers/lib/OpenLayers/Map.js (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/openlayers/lib/OpenLayers/Map.js
r2135 r2167 432 432 */ 433 433 setBaseLayer: function(newBaseLayer, noEvent) { 434 var oldBaseLayer = this.baseLayer; 435 436 if (newBaseLayer != oldBaseLayer) { 434 var oldExtent = null; 435 if(this.baseLayer) { 436 oldExtent = this.baseLayer.getExtent(); 437 } 438 439 if (newBaseLayer != this.baseLayer) { 437 440 438 441 // is newBaseLayer an already loaded layer? … … 440 443 441 444 // make the old base layer invisible 442 if ( oldBaseLayer != null) {443 oldBaseLayer.setVisibility(false, noEvent);445 if (this.baseLayer != null) { 446 this.baseLayer.setVisibility(false, noEvent); 444 447 } 445 448 … … 451 454 var center = this.getCenter(); 452 455 if (center != null) { 453 if (old BaseLayer== null) {456 if (oldExtent == null) { 454 457 this.setCenter(center); 455 458 } else { 456 this.zoomToExtent(old BaseLayer.getExtent());459 this.zoomToExtent(oldExtent); 457 460 } 458 461 }
