Set the interacting flag on pointerdrag instead of pointerdown
This commit is contained in:
@@ -73,6 +73,10 @@ class DragPan extends PointerInteraction {
|
|||||||
* @inheritDoc
|
* @inheritDoc
|
||||||
*/
|
*/
|
||||||
handleDragEvent(mapBrowserEvent) {
|
handleDragEvent(mapBrowserEvent) {
|
||||||
|
if (!this.panning_) {
|
||||||
|
this.panning_ = true;
|
||||||
|
this.getMap().getView().beginInteraction();
|
||||||
|
}
|
||||||
const targetPointers = this.targetPointers;
|
const targetPointers = this.targetPointers;
|
||||||
const centroid = centroidFromPointers(targetPointers);
|
const centroid = centroidFromPointers(targetPointers);
|
||||||
if (targetPointers.length == this.lastPointersCount_) {
|
if (targetPointers.length == this.lastPointersCount_) {
|
||||||
@@ -149,10 +153,6 @@ class DragPan extends PointerInteraction {
|
|||||||
if (view.getAnimating()) {
|
if (view.getAnimating()) {
|
||||||
view.cancelAnimations();
|
view.cancelAnimations();
|
||||||
}
|
}
|
||||||
if (!this.panning_) {
|
|
||||||
this.panning_ = true;
|
|
||||||
this.getMap().getView().beginInteraction();
|
|
||||||
}
|
|
||||||
if (this.kinetic_) {
|
if (this.kinetic_) {
|
||||||
this.kinetic_.begin();
|
this.kinetic_.begin();
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user