- npm updated (babel_core)

- correct imports for DomEvent in draw.component.vue
This commit is contained in:
Kaimbacher 2023-05-03 10:02:48 +02:00
parent e110826e1a
commit a48a2d9704
2 changed files with 27 additions and 24 deletions

View file

@ -25,7 +25,7 @@ import { MapService } from '@/Stores/map.service';
import { Map } from 'leaflet/src/map/index';
// import { LayerGroup } from 'leaflet/src/layer/LayerGroup';
// import { LatLngBounds, Rectangle } from 'leaflet';
import * as DomEvent from 'leaflet/src/dom/DomEvent';
import { on, off , preventDefault } from 'leaflet/src/dom/DomEvent';
import { Rectangle } from 'leaflet/src/layer/vector/Rectangle';
import { LatLngBounds } from 'leaflet/src/geo/LatLngBounds';
@ -141,7 +141,7 @@ export default class DrawControlComponent extends Vue {
// (update): we have to send passive now to prevent scroll, because by default it is {passive: true} now, which means,
// handler can't event.preventDefault
// check the news https://developers.google.com/web/updates/2016/06/passive-event-listeners
document.addEventListener('touchstart', DomEvent.preventDefault, { passive: false });
document.addEventListener('touchstart', preventDefault, { passive: false });
}
}
@ -164,10 +164,10 @@ export default class DrawControlComponent extends Vue {
.off('touchstart', this._onMouseDown, this)
.off('touchmove', this._onMouseMove, this);
DomEvent.off(document, 'mouseup', this._onMouseUp, this);
DomEvent.off(document, 'touchend', this._onMouseUp, this);
off(document, 'mouseup', this._onMouseUp, this);
off(document, 'touchend', this._onMouseUp, this);
document.removeEventListener('touchstart', DomEvent.preventDefault);
document.removeEventListener('touchstart', preventDefault);
// If the box element doesn't exist they must not have moved the mouse, so don't need to destroy/return
// if (this._shape) {
@ -183,9 +183,12 @@ export default class DrawControlComponent extends Vue {
this._isDrawing = true;
this._startLatLng = e.latlng;
DomEvent.on(document, 'mouseup', this._onMouseUp, this)
.on(document, 'touchend', this._onMouseUp, this)
.preventDefault(e.originalEvent);
// DomEvent.on(document, 'mouseup', this._onMouseUp, this)
// .on(document, 'touchend', this._onMouseUp, this)
// .preventDefault(e.originalEvent);
on(document, 'mouseup', this._onMouseUp, this);
on(document, 'touchend', this._onMouseUp, this);
preventDefault(e.originalEvent);
}
private _onMouseMove(e) {