Added check on map zooming to disable box select

This commit is contained in:
Pax1601 2024-07-07 19:12:56 +02:00
parent 1dceb0b421
commit 98862d917c

View File

@ -72,7 +72,7 @@ export class Map extends L.Map {
#temporaryMarkers: TemporaryUnitMarker[] = [];
#selecting: boolean = false;
#isSelecting: boolean = false;
#isZooming: boolean = false;
#previousZoom: number = 0;
@ -96,7 +96,7 @@ export class Map extends L.Map {
#waitingForDoubleClick: boolean = false;
#doubleClickTimer: number = 0;
#longPressTimer: number = 0;
#dragging: boolean = false;
#isDragging: boolean = false;
/**
*
@ -801,19 +801,19 @@ export class Map extends L.Map {
#onContextMenu(e: any) {}
#onDragStart(e: any) {
this.#dragging = true;
this.#isDragging = true;
}
#onDragEnd(e: any) {
this.#dragging = false;
this.#isDragging = false;
}
#onSelectionStart(e: any) {
this.#selecting = true;
this.#isSelecting = true;
}
#onSelectionEnd(e: any) {
this.#selecting = false;
this.#isSelecting = false;
clearTimeout(this.#leftClickTimer);
this.#preventLeftClick = true;
this.#leftClickTimer = window.setTimeout(() => {
@ -829,7 +829,7 @@ export class Map extends L.Map {
#onMouseDown(e: any) {
this.#longPressTimer = window.setTimeout(()=> {
if (!this.#dragging)
if (!this.#isDragging && !this.#isZooming)
if (e.type === "touchstart")
document.dispatchEvent(new CustomEvent("mapForceBoxSelect", {detail: e}));
else