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:
@@ -1749,7 +1749,12 @@ OpenLayers.Map = OpenLayers.Class({
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (this.baseLayer.wrapDateLine) {
|
if (this.baseLayer.wrapDateLine) {
|
||||||
|
var requestedZoom = zoom;
|
||||||
zoom = this.adjustZoom(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
|
// dragging is false by default
|
||||||
var dragging = options.dragging || this.dragging;
|
var dragging = options.dragging || this.dragging;
|
||||||
|
|||||||
Reference in New Issue
Block a user