View / apply constraints when an interaction starts
Previously, an interaction could begin while target values (center/resolution) were out of the allowed range, causing a glitch where the view zoom/position would jump suddenly.
This commit is contained in:
@@ -135,6 +135,7 @@ export function zoomByDelta(view, delta, opt_anchor, opt_duration) {
|
||||
const newZoom = view.getConstrainedZoom(currentZoom + delta);
|
||||
const newResolution = view.getResolutionForZoom(newZoom);
|
||||
|
||||
view.resolveConstraints(0);
|
||||
if (view.getAnimating()) {
|
||||
view.cancelAnimations();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user