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 -5
View File
@@ -131,11 +131,7 @@ class PinchRotate extends PointerInteraction {
if (this.targetPointers.length < 2) {
const map = mapBrowserEvent.map;
const view = map.getView();
view.endInteraction();
if (this.rotating_) {
const rotation = view.getRotation();
rotate(view, rotation, this.anchor_, this.duration_);
}
view.endInteraction(this.duration_);
return false;
} else {
return true;