View / add a resolveConstraints method to end interactions

This will help making sure that the view will come back to a "rested" state
once the interactions are over.

Interactions no longer need to handle the animation back to a rested state,
they simply call `endInteraction` with the desired duration and direction.
This commit is contained in:
Olivier Guyot
2019-01-14 17:10:55 +01:00
parent 1c5fd62e43
commit a6f65df8c4
8 changed files with 81 additions and 80 deletions
+1 -3
View File
@@ -113,10 +113,8 @@ class DragRotateAndZoom extends PointerInteraction {
const map = mapBrowserEvent.map;
const view = map.getView();
view.endInteraction();
const direction = this.lastScaleDelta_ - 1;
rotate(view, view.getRotation());
zoom(view, view.getResolution(), undefined, this.duration_, direction);
view.endInteraction(this.duration_, direction);
this.lastScaleDelta_ = 0;
return false;
}