Don't set the new lonlat if the new zoom is not valid.

This avoids unwanted panning without zooming when using the mousewheel to zoom out on a wrapDateLine map (see #109).
This commit is contained in:
ahocevar
2011-12-16 11:22:31 +01:00
parent 0176d052a7
commit 9c50bb5c01

View File

@@ -1749,7 +1749,12 @@ OpenLayers.Map = OpenLayers.Class({
}
}
if (this.baseLayer.wrapDateLine) {
var requestedZoom = zoom;
zoom = this.adjustZoom(zoom);
if (zoom !== requestedZoom) {
// zoom was adjusted, so keep old lonlat to avoid panning
lonlat = this.getCenter();
}
}
// dragging is false by default
var dragging = options.dragging || this.dragging;