- npm updates
- Picking.js: correct events for destop and touch devices
This commit is contained in:
parent
486896581c
commit
4be927b82b
888
package-lock.json
generated
888
package-lock.json
generated
File diff suppressed because it is too large
Load Diff
|
@ -43,12 +43,10 @@ export class Picking {
|
||||||
simulation.scene.add(this.plane);
|
simulation.scene.add(this.plane);
|
||||||
|
|
||||||
this.domElement = simulation.renderer.domElement;
|
this.domElement = simulation.renderer.domElement;
|
||||||
|
domEvent.on(this.domElement, 'mousemove', this.mouseMove, this);
|
||||||
if (this.touchCapable) {
|
if (this.touchCapable == true) {
|
||||||
domEvent.on(this.domElement, 'mousemove', this.mouseMove, this);
|
|
||||||
domEvent.on(this.domElement, 'touchstart', this.beginDrag, this);
|
domEvent.on(this.domElement, 'touchstart', this.beginDrag, this);
|
||||||
} else {
|
} else {
|
||||||
domEvent.on(this.domElement, 'mousemove', this.mouseMove, this);
|
|
||||||
domEvent.on(this.domElement, 'mousedown', this.beginDrag, this);
|
domEvent.on(this.domElement, 'mousedown', this.beginDrag, this);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -188,20 +186,25 @@ export class Picking {
|
||||||
};
|
};
|
||||||
|
|
||||||
let endDrag = function (event) {
|
let endDrag = function (event) {
|
||||||
|
event.preventDefault();
|
||||||
|
event.stopPropagation();
|
||||||
this.isDraging = false;
|
this.isDraging = false;
|
||||||
this.simulation.map.enabled = true;
|
this.simulation.map.enabled = true;
|
||||||
this.simulation.renderer.domElement.style.cursor = 'pointer';
|
this.simulation.renderer.domElement.style.cursor = 'pointer';
|
||||||
domEvent.off(this.domElement, "mousemove", continueDrag, this);
|
|
||||||
domEvent.off(this.domElement, "touchmove", continueDrag, this);
|
|
||||||
|
|
||||||
domEvent.off(this.domElement, "mouseup", endDrag, this);
|
if (this.touchCapable == true) {
|
||||||
domEvent.off(this.domElement, 'mouseleave', endDrag, this);
|
domEvent.off(this.domElement, 'touchmove', continueDrag, this);
|
||||||
domEvent.off(this.domElement, 'touchend', endDrag, this);
|
domEvent.off(this.domElement, 'touchend', endDrag, this);
|
||||||
domEvent.off(this.domElement, 'touchcancel', endDrag, this);
|
domEvent.off(this.domElement, 'touchcancel', endDrag, this);
|
||||||
domEvent.off(this.domElement, 'touchleave', endDrag, this);
|
domEvent.off(this.domElement, 'touchleave', endDrag, this);
|
||||||
|
} else {
|
||||||
|
domEvent.off(this.domElement, 'mousemove', continueDrag, this);
|
||||||
|
domEvent.off(this.domElement, 'mouseup', endDrag, this);
|
||||||
|
domEvent.off(this.domElement, 'mouseleave', endDrag, this);
|
||||||
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
if (this.touchCapable) {
|
if (this.touchCapable == true) {
|
||||||
domEvent.on(this.domElement, 'touchmove', continueDrag, this);
|
domEvent.on(this.domElement, 'touchmove', continueDrag, this);
|
||||||
domEvent.on(this.domElement, 'touchend', endDrag, this);
|
domEvent.on(this.domElement, 'touchend', endDrag, this);
|
||||||
domEvent.on(this.domElement, 'touchcancel', endDrag, this);
|
domEvent.on(this.domElement, 'touchcancel', endDrag, this);
|
||||||
|
|
Loading…
Reference in New Issue
Block a user