| 710 | | if (oldExtent == null) { |
|---|
| 711 | | // simply set center but force zoom change |
|---|
| 712 | | this.setCenter( |
|---|
| 713 | | center, |
|---|
| 714 | | this.getZoomForResolution(this.resolution, true), |
|---|
| 715 | | false, true |
|---|
| 716 | | ); |
|---|
| 717 | | } else { |
|---|
| 718 | | // zoom to oldExtent *and* force zoom change |
|---|
| 719 | | this.setCenter(oldExtent.getCenterLonLat(), |
|---|
| 720 | | this.getZoomForExtent(oldExtent, true), |
|---|
| 721 | | false, true); |
|---|
| 722 | | } |
|---|
| | 710 | |
|---|
| | 711 | //either get the center from the old Extent or just from |
|---|
| | 712 | // the current center of the map. |
|---|
| | 713 | var newCenter = (oldExtent) |
|---|
| | 714 | ? oldExtent.getCenterLonLat() |
|---|
| | 715 | : center; |
|---|
| | 716 | |
|---|
| | 717 | //the new zoom will either come from the old Extent or |
|---|
| | 718 | // from the current resolution of the map |
|---|
| | 719 | var newZoom = (oldExtent) |
|---|
| | 720 | ? this.getZoomForExtent(oldExtent, true) |
|---|
| | 721 | : this.getZoomForResolution(this.resolution, true); |
|---|
| | 722 | |
|---|
| | 723 | // zoom and force zoom change |
|---|
| | 724 | this.setCenter(newCenter, newZoom, false, true); |
|---|