leaflet-polydraw 0.9.0 → 0.9.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/polydraw.es.js
CHANGED
|
@@ -17514,7 +17514,6 @@ class PolygonDrawManager {
|
|
|
17514
17514
|
// Point-to-Point drawing state
|
|
17515
17515
|
__publicField(this, "p2pMarkers", []);
|
|
17516
17516
|
__publicField(this, "isModifierKeyHeld", false);
|
|
17517
|
-
console.log("PolygonDrawManager constructor");
|
|
17518
17517
|
this.turfHelper = dependencies.turfHelper;
|
|
17519
17518
|
this.map = dependencies.map;
|
|
17520
17519
|
this.config = dependencies.config;
|
|
@@ -17526,7 +17525,6 @@ class PolygonDrawManager {
|
|
|
17526
17525
|
* Handle mouse move during freehand drawing
|
|
17527
17526
|
*/
|
|
17528
17527
|
mouseMove(event) {
|
|
17529
|
-
console.log("mouseMove");
|
|
17530
17528
|
if ("latlng" in event && event.latlng) {
|
|
17531
17529
|
this.tracer.addLatLng(event.latlng);
|
|
17532
17530
|
} else if ("touches" in event && event.touches && event.touches.length > 0) {
|
|
@@ -17541,7 +17539,6 @@ class PolygonDrawManager {
|
|
|
17541
17539
|
* Handle mouse up/leave to complete freehand drawing
|
|
17542
17540
|
*/
|
|
17543
17541
|
async mouseUpLeave(event) {
|
|
17544
|
-
console.log("mouseUpLeave");
|
|
17545
17542
|
const tracerGeoJSON = this.tracer.toGeoJSON();
|
|
17546
17543
|
if (!tracerGeoJSON || !tracerGeoJSON.geometry || !tracerGeoJSON.geometry.coordinates || tracerGeoJSON.geometry.coordinates.length < 3) {
|
|
17547
17544
|
return {
|
|
@@ -17587,7 +17584,6 @@ class PolygonDrawManager {
|
|
|
17587
17584
|
* Handle point-to-point click
|
|
17588
17585
|
*/
|
|
17589
17586
|
handlePointToPointClick(clickLatLng) {
|
|
17590
|
-
console.log("handlePointToPointClick");
|
|
17591
17587
|
if (!clickLatLng) {
|
|
17592
17588
|
return;
|
|
17593
17589
|
}
|
|
@@ -17616,7 +17612,6 @@ class PolygonDrawManager {
|
|
|
17616
17612
|
this.updateP2PTracer();
|
|
17617
17613
|
});
|
|
17618
17614
|
pointMarker.on("click", (e) => {
|
|
17619
|
-
console.log("p2p marker click");
|
|
17620
17615
|
if (this.isModifierKeyHeld && this.config.modes.edgeDeletion) {
|
|
17621
17616
|
this.deleteP2PMarker(pointMarker);
|
|
17622
17617
|
L.DomEvent.stopPropagation(e);
|
|
@@ -17646,7 +17641,6 @@ class PolygonDrawManager {
|
|
|
17646
17641
|
}
|
|
17647
17642
|
});
|
|
17648
17643
|
pointMarker.on("click", (e) => {
|
|
17649
|
-
console.log("p2p first marker click");
|
|
17650
17644
|
if (this.isModifierKeyHeld && this.config.modes.edgeDeletion) {
|
|
17651
17645
|
this.deleteP2PMarker(pointMarker);
|
|
17652
17646
|
L.DomEvent.stopPropagation(e);
|
|
@@ -17667,7 +17661,6 @@ class PolygonDrawManager {
|
|
|
17667
17661
|
* Handle double-click to complete point-to-point polygon
|
|
17668
17662
|
*/
|
|
17669
17663
|
handleDoubleClick(e) {
|
|
17670
|
-
console.log("handleDoubleClick");
|
|
17671
17664
|
if (this.modeManager.getCurrentMode() !== DrawMode.PointToPoint) {
|
|
17672
17665
|
return;
|
|
17673
17666
|
}
|
|
@@ -17679,7 +17672,6 @@ class PolygonDrawManager {
|
|
|
17679
17672
|
* Complete point-to-point polygon drawing
|
|
17680
17673
|
*/
|
|
17681
17674
|
completePointToPointPolygon() {
|
|
17682
|
-
console.log("PolygonDrawManager completePointToPointPolygon");
|
|
17683
17675
|
const points = this.p2pMarkers.map((marker) => marker.getLatLng());
|
|
17684
17676
|
if (points.length < 3) {
|
|
17685
17677
|
return;
|
|
@@ -17710,7 +17702,6 @@ class PolygonDrawManager {
|
|
|
17710
17702
|
* Cancel point-to-point drawing
|
|
17711
17703
|
*/
|
|
17712
17704
|
cancelPointToPointDrawing() {
|
|
17713
|
-
console.log("PolygonDrawManager cancelPointToPointDrawing");
|
|
17714
17705
|
this.clearP2pMarkers();
|
|
17715
17706
|
this.resetTracer();
|
|
17716
17707
|
this.eventManager.emit("polydraw:draw:cancel", {
|
|
@@ -17721,7 +17712,6 @@ class PolygonDrawManager {
|
|
|
17721
17712
|
* Clear all P2P markers
|
|
17722
17713
|
*/
|
|
17723
17714
|
clearP2pMarkers() {
|
|
17724
|
-
console.log("PolygonDrawManager clearP2pMarkers");
|
|
17725
17715
|
this.p2pMarkers.forEach((marker) => this.map.removeLayer(marker));
|
|
17726
17716
|
this.p2pMarkers = [];
|
|
17727
17717
|
}
|
|
@@ -17729,7 +17719,6 @@ class PolygonDrawManager {
|
|
|
17729
17719
|
* Reset the tracer
|
|
17730
17720
|
*/
|
|
17731
17721
|
resetTracer() {
|
|
17732
|
-
console.log("PolygonDrawManager resetTracer");
|
|
17733
17722
|
this.tracer.setLatLngs([]);
|
|
17734
17723
|
try {
|
|
17735
17724
|
this.tracer.setStyle({
|
|
@@ -17742,7 +17731,6 @@ class PolygonDrawManager {
|
|
|
17742
17731
|
* Check if clicking on the first point to close polygon
|
|
17743
17732
|
*/
|
|
17744
17733
|
isClickingFirstPoint(clickLatLng, firstPoint) {
|
|
17745
|
-
console.log("PolygonDrawManager isClickingFirstPoint");
|
|
17746
17734
|
if (!firstPoint) return false;
|
|
17747
17735
|
const zoom = this.map.getZoom();
|
|
17748
17736
|
const baseTolerance = 5e-4;
|
|
@@ -17793,21 +17781,18 @@ class PolygonDrawManager {
|
|
|
17793
17781
|
* Get current P2P markers (for external access)
|
|
17794
17782
|
*/
|
|
17795
17783
|
getP2pMarkers() {
|
|
17796
|
-
console.log("PolygonDrawManager getP2pMarkers");
|
|
17797
17784
|
return [...this.p2pMarkers];
|
|
17798
17785
|
}
|
|
17799
17786
|
/**
|
|
17800
17787
|
* Check if currently in point-to-point drawing mode
|
|
17801
17788
|
*/
|
|
17802
17789
|
isInPointToPointMode() {
|
|
17803
|
-
console.log("PolygonDrawManager isInPointToPointMode");
|
|
17804
17790
|
return this.modeManager.getCurrentMode() === DrawMode.PointToPoint;
|
|
17805
17791
|
}
|
|
17806
17792
|
/**
|
|
17807
17793
|
* Get current tracer points count
|
|
17808
17794
|
*/
|
|
17809
17795
|
getTracerPointsCount() {
|
|
17810
|
-
console.log("PolygonDrawManager getTracerPointsCount");
|
|
17811
17796
|
const points = this.tracer.getLatLngs();
|
|
17812
17797
|
return points.length;
|
|
17813
17798
|
}
|
|
@@ -18424,7 +18409,6 @@ class PolygonInteractionManager {
|
|
|
18424
18409
|
__publicField(this, "removeFeatureGroup");
|
|
18425
18410
|
// Polygon dragging methods
|
|
18426
18411
|
__publicField(this, "onPolygonMouseMove", (e) => {
|
|
18427
|
-
console.log("PolygonInteractionManager onPolygonMouseMove");
|
|
18428
18412
|
if (!this.currentDragPolygon || !this.currentDragPolygon._polydrawDragData.isDragging) return;
|
|
18429
18413
|
const polygon2 = this.currentDragPolygon;
|
|
18430
18414
|
const dragData = polygon2._polydrawDragData;
|
|
@@ -18442,7 +18426,6 @@ class PolygonInteractionManager {
|
|
|
18442
18426
|
this.updateMarkersAndHoleLinesDuringDrag(polygon2, offsetLat, offsetLng);
|
|
18443
18427
|
});
|
|
18444
18428
|
__publicField(this, "onPolygonMouseUp", (e) => {
|
|
18445
|
-
console.log("PolygonInteractionManager onPolygonMouseUp");
|
|
18446
18429
|
if (!this.currentDragPolygon || !this.currentDragPolygon._polydrawDragData.isDragging) return;
|
|
18447
18430
|
const polygon2 = this.currentDragPolygon;
|
|
18448
18431
|
const dragData = polygon2._polydrawDragData;
|
|
@@ -18472,7 +18455,6 @@ class PolygonInteractionManager {
|
|
|
18472
18455
|
this.currentDragPolygon = null;
|
|
18473
18456
|
});
|
|
18474
18457
|
__publicField(this, "onMarkerHoverForEdgeDeletionEvent", (e) => {
|
|
18475
|
-
console.log("PolygonInteractionManager onMarkerHoverForEdgeDeletionEvent");
|
|
18476
18458
|
if (!this.isModifierKeyHeld) return;
|
|
18477
18459
|
const element = e.target;
|
|
18478
18460
|
if (element) {
|
|
@@ -18482,7 +18464,6 @@ class PolygonInteractionManager {
|
|
|
18482
18464
|
}
|
|
18483
18465
|
});
|
|
18484
18466
|
__publicField(this, "onMarkerLeaveForEdgeDeletionEvent", (e) => {
|
|
18485
|
-
console.log("PolygonInteractionManager onMarkerLeaveForEdgeDeletionEvent");
|
|
18486
18467
|
const element = e.target;
|
|
18487
18468
|
if (element) {
|
|
18488
18469
|
element.style.backgroundColor = "";
|
|
@@ -18490,7 +18471,6 @@ class PolygonInteractionManager {
|
|
|
18490
18471
|
element.classList.remove("edge-deletion-hover");
|
|
18491
18472
|
}
|
|
18492
18473
|
});
|
|
18493
|
-
console.log("PolygonInteractionManager constructor");
|
|
18494
18474
|
this.turfHelper = dependencies.turfHelper;
|
|
18495
18475
|
this.polygonInformation = dependencies.polygonInformation;
|
|
18496
18476
|
this.map = dependencies.map;
|
|
@@ -18505,7 +18485,6 @@ class PolygonInteractionManager {
|
|
|
18505
18485
|
* Add markers to a polygon feature group
|
|
18506
18486
|
*/
|
|
18507
18487
|
addMarkers(latlngs, featureGroup) {
|
|
18508
|
-
console.log("PolygonInteractionManager addMarkers");
|
|
18509
18488
|
let menuMarkerIdx = this.getMarkerIndex(latlngs, this.config.markers.markerMenuIcon.position);
|
|
18510
18489
|
let deleteMarkerIdx = this.getMarkerIndex(
|
|
18511
18490
|
latlngs,
|
|
@@ -18569,12 +18548,14 @@ class PolygonInteractionManager {
|
|
|
18569
18548
|
});
|
|
18570
18549
|
const el = marker.getElement();
|
|
18571
18550
|
if (el) {
|
|
18572
|
-
el.addEventListener(
|
|
18573
|
-
|
|
18574
|
-
e
|
|
18575
|
-
|
|
18551
|
+
el.addEventListener(
|
|
18552
|
+
"touchstart",
|
|
18553
|
+
(e) => {
|
|
18554
|
+
e.stopPropagation();
|
|
18555
|
+
},
|
|
18556
|
+
{ passive: true }
|
|
18557
|
+
);
|
|
18576
18558
|
el.addEventListener("touchend", (e) => {
|
|
18577
|
-
console.log("marker touchend");
|
|
18578
18559
|
e.preventDefault();
|
|
18579
18560
|
e.stopPropagation();
|
|
18580
18561
|
marker.fire("click");
|
|
@@ -18604,7 +18585,6 @@ class PolygonInteractionManager {
|
|
|
18604
18585
|
if (i === menuMarkerIdx && this.config.markers.menuMarker) {
|
|
18605
18586
|
marker.options.zIndexOffset = this.config.markers.markerMenuIcon.zIndexOffset ?? this.config.markers.zIndexOffset;
|
|
18606
18587
|
marker.on("click", () => {
|
|
18607
|
-
console.log("menu marker clicked");
|
|
18608
18588
|
const polygonGeoJSON = this.getPolygonGeoJSONFromFeatureGroup(featureGroup);
|
|
18609
18589
|
const centerOfMass2 = PolygonUtil.getCenterOfMass(polygonGeoJSON);
|
|
18610
18590
|
const menuPopup = this.generateMenuMarkerPopup(latlngs, featureGroup);
|
|
@@ -18624,14 +18604,12 @@ class PolygonInteractionManager {
|
|
|
18624
18604
|
popupContent.style.transform = `translateX(${mapBounds.right - popupBounds.right}px)`;
|
|
18625
18605
|
}
|
|
18626
18606
|
}, 0);
|
|
18627
|
-
console.log("popupopen, setting touchAction to manipulation");
|
|
18628
18607
|
const container2 = this.map.getContainer();
|
|
18629
18608
|
if (container2) {
|
|
18630
18609
|
container2.style.touchAction = "manipulation";
|
|
18631
18610
|
}
|
|
18632
18611
|
});
|
|
18633
18612
|
marker.on("popupclose", () => {
|
|
18634
|
-
console.log("popupclose, resetting touchAction");
|
|
18635
18613
|
const container2 = this.map.getContainer();
|
|
18636
18614
|
if (container2) {
|
|
18637
18615
|
container2.style.touchAction = "";
|
|
@@ -18644,7 +18622,6 @@ class PolygonInteractionManager {
|
|
|
18644
18622
|
const perimeter = this.getTotalPolygonPerimeter(polygonGeoJSON);
|
|
18645
18623
|
marker.options.zIndexOffset = this.config.markers.markerInfoIcon.zIndexOffset ?? this.config.markers.zIndexOffset;
|
|
18646
18624
|
marker.on("click", () => {
|
|
18647
|
-
console.log("info marker clicked");
|
|
18648
18625
|
const infoPopup = this.generateInfoMarkerPopup(area2, perimeter);
|
|
18649
18626
|
const centerOfMass2 = PolygonUtil.getCenterOfMass(polygonGeoJSON);
|
|
18650
18627
|
infoPopup.setLatLng(centerOfMass2).openOn(this.map);
|
|
@@ -18663,14 +18640,12 @@ class PolygonInteractionManager {
|
|
|
18663
18640
|
popupContent.style.transform = `translateX(${mapBounds.right - popupBounds.right}px)`;
|
|
18664
18641
|
}
|
|
18665
18642
|
}, 0);
|
|
18666
|
-
console.log("popupopen, setting touchAction to manipulation");
|
|
18667
18643
|
const container2 = this.map.getContainer();
|
|
18668
18644
|
if (container2) {
|
|
18669
18645
|
container2.style.touchAction = "manipulation";
|
|
18670
18646
|
}
|
|
18671
18647
|
});
|
|
18672
18648
|
marker.on("popupclose", () => {
|
|
18673
|
-
console.log("popupclose, resetting touchAction");
|
|
18674
18649
|
const container2 = this.map.getContainer();
|
|
18675
18650
|
if (container2) {
|
|
18676
18651
|
container2.style.touchAction = "";
|
|
@@ -18686,7 +18661,6 @@ class PolygonInteractionManager {
|
|
|
18686
18661
|
});
|
|
18687
18662
|
marker.on("click", (e) => {
|
|
18688
18663
|
var _a2;
|
|
18689
|
-
console.log("marker click");
|
|
18690
18664
|
if (this.modeManager.isInOffMode()) {
|
|
18691
18665
|
if (this.isModifierKeyPressed(e.originalEvent)) {
|
|
18692
18666
|
const poly = (_a2 = featureGroup.getLayers().find((layer) => layer instanceof L.Polygon)) == null ? void 0 : _a2.toGeoJSON();
|
|
@@ -18715,7 +18689,6 @@ class PolygonInteractionManager {
|
|
|
18715
18689
|
* Add hole markers to a polygon feature group
|
|
18716
18690
|
*/
|
|
18717
18691
|
addHoleMarkers(latlngs, featureGroup) {
|
|
18718
|
-
console.log("PolygonInteractionManager addHoleMarkers");
|
|
18719
18692
|
latlngs.forEach((latlng, i) => {
|
|
18720
18693
|
const iconClasses = this.config.markers.holeIcon.styleClasses;
|
|
18721
18694
|
const processedClasses = Array.isArray(iconClasses) ? iconClasses : [iconClasses];
|
|
@@ -18750,7 +18723,6 @@ class PolygonInteractionManager {
|
|
|
18750
18723
|
* Add edge click listeners to a polygon
|
|
18751
18724
|
*/
|
|
18752
18725
|
addEdgeClickListeners(polygon2, featureGroup) {
|
|
18753
|
-
console.log("PolygonInteractionManager addEdgeClickListeners");
|
|
18754
18726
|
const rawLatLngs = polygon2.getLatLngs();
|
|
18755
18727
|
let processedRings;
|
|
18756
18728
|
if (Array.isArray(rawLatLngs) && rawLatLngs.length > 0) {
|
|
@@ -18813,7 +18785,6 @@ class PolygonInteractionManager {
|
|
|
18813
18785
|
* Enable polygon dragging functionality
|
|
18814
18786
|
*/
|
|
18815
18787
|
enablePolygonDragging(polygon2, latlngs) {
|
|
18816
|
-
console.log("PolygonInteractionManager enablePolygonDragging");
|
|
18817
18788
|
if (!this.config.modes.dragPolygons) return;
|
|
18818
18789
|
polygon2._polydrawOriginalLatLngs = latlngs;
|
|
18819
18790
|
polygon2._polydrawDragData = {
|
|
@@ -18822,7 +18793,6 @@ class PolygonInteractionManager {
|
|
|
18822
18793
|
startLatLngs: null
|
|
18823
18794
|
};
|
|
18824
18795
|
polygon2.on("mousedown", (e) => {
|
|
18825
|
-
console.log("polygon mousedown");
|
|
18826
18796
|
if (!this.modeManager.isInOffMode()) {
|
|
18827
18797
|
L.DomEvent.stopPropagation(e);
|
|
18828
18798
|
this.map.fire("mousedown", e);
|
|
@@ -18875,7 +18845,6 @@ class PolygonInteractionManager {
|
|
|
18875
18845
|
* Update marker draggable state based on current mode
|
|
18876
18846
|
*/
|
|
18877
18847
|
updateMarkerDraggableState() {
|
|
18878
|
-
console.log("PolygonInteractionManager updateMarkerDraggableState");
|
|
18879
18848
|
const shouldBeDraggable = this.modeManager.canPerformAction("markerDrag");
|
|
18880
18849
|
this.getFeatureGroups().forEach((featureGroup) => {
|
|
18881
18850
|
featureGroup.eachLayer((layer) => {
|
|
@@ -18900,7 +18869,6 @@ class PolygonInteractionManager {
|
|
|
18900
18869
|
* Update all markers for edge deletion visual feedback
|
|
18901
18870
|
*/
|
|
18902
18871
|
updateAllMarkersForEdgeDeletion(showFeedback) {
|
|
18903
|
-
console.log("PolygonInteractionManager updateAllMarkersForEdgeDeletion");
|
|
18904
18872
|
this.getFeatureGroups().forEach((featureGroup) => {
|
|
18905
18873
|
featureGroup.eachLayer((layer) => {
|
|
18906
18874
|
if (layer instanceof L.Marker) {
|
|
@@ -18913,7 +18881,6 @@ class PolygonInteractionManager {
|
|
|
18913
18881
|
* Update individual marker for edge deletion visual feedback
|
|
18914
18882
|
*/
|
|
18915
18883
|
updateMarkerForEdgeDeletion(marker, showFeedback) {
|
|
18916
|
-
console.log("PolygonInteractionManager updateMarkerForEdgeDeletion");
|
|
18917
18884
|
const element = marker.getElement();
|
|
18918
18885
|
if (!element) return;
|
|
18919
18886
|
if (showFeedback) {
|
|
@@ -18930,12 +18897,10 @@ class PolygonInteractionManager {
|
|
|
18930
18897
|
* Set modifier key held state
|
|
18931
18898
|
*/
|
|
18932
18899
|
setModifierKeyHeld(isHeld) {
|
|
18933
|
-
console.log("PolygonInteractionManager setModifierKeyHeld");
|
|
18934
18900
|
this.isModifierKeyHeld = isHeld;
|
|
18935
18901
|
}
|
|
18936
18902
|
// Private methods
|
|
18937
18903
|
onEdgeClick(e, edgePolyline) {
|
|
18938
|
-
console.log("onEdgeClick");
|
|
18939
18904
|
if (!this.config.modes.attachElbow) {
|
|
18940
18905
|
return;
|
|
18941
18906
|
}
|
|
@@ -18975,7 +18940,6 @@ class PolygonInteractionManager {
|
|
|
18975
18940
|
L.DomEvent.stopPropagation(e);
|
|
18976
18941
|
}
|
|
18977
18942
|
highlightEdgeOnHover(edgePolyline, isHovering) {
|
|
18978
|
-
console.log("PolygonInteractionManager highlightEdgeOnHover");
|
|
18979
18943
|
if (isHovering) {
|
|
18980
18944
|
edgePolyline.setStyle({
|
|
18981
18945
|
color: "#7a9441",
|
|
@@ -18991,7 +18955,6 @@ class PolygonInteractionManager {
|
|
|
18991
18955
|
}
|
|
18992
18956
|
}
|
|
18993
18957
|
elbowClicked(e, poly) {
|
|
18994
|
-
console.log("elbowClicked");
|
|
18995
18958
|
if (!this.config.modes.edgeDeletion) {
|
|
18996
18959
|
return;
|
|
18997
18960
|
}
|
|
@@ -19040,7 +19003,6 @@ class PolygonInteractionManager {
|
|
|
19040
19003
|
});
|
|
19041
19004
|
}
|
|
19042
19005
|
findFeatureGroupForPoly(poly) {
|
|
19043
|
-
console.log("PolygonInteractionManager findFeatureGroupForPoly");
|
|
19044
19006
|
for (const featureGroup of this.getFeatureGroups()) {
|
|
19045
19007
|
const featureCollection2 = featureGroup.toGeoJSON();
|
|
19046
19008
|
if (featureCollection2 && featureCollection2.features && featureCollection2.features[0]) {
|
|
@@ -19057,7 +19019,6 @@ class PolygonInteractionManager {
|
|
|
19057
19019
|
console.warn("No active marker set for dragging.");
|
|
19058
19020
|
return;
|
|
19059
19021
|
}
|
|
19060
|
-
console.log("PolygonInteractionManager markerDrag", featureGroup);
|
|
19061
19022
|
const newPos = [];
|
|
19062
19023
|
let testarray = [];
|
|
19063
19024
|
let hole = [];
|
|
@@ -19133,7 +19094,6 @@ class PolygonInteractionManager {
|
|
|
19133
19094
|
layerLength[0].setLatLngs(newPos);
|
|
19134
19095
|
}
|
|
19135
19096
|
async markerDragEnd(featureGroup) {
|
|
19136
|
-
console.log("PolygonInteractionManager markerDragEnd");
|
|
19137
19097
|
this.polygonInformation.deletePolygonInformationStorage();
|
|
19138
19098
|
const featureCollection2 = featureGroup.toGeoJSON();
|
|
19139
19099
|
if (!featureCollection2.features || featureCollection2.features.length === 0) {
|
|
@@ -19194,7 +19154,6 @@ class PolygonInteractionManager {
|
|
|
19194
19154
|
this.polygonInformation.createPolygonInformationStorage(this.getFeatureGroups());
|
|
19195
19155
|
}
|
|
19196
19156
|
offsetPolygonCoordinates(latLngs, offsetLat, offsetLng) {
|
|
19197
|
-
console.log("PolygonInteractionManager offsetPolygonCoordinates");
|
|
19198
19157
|
if (!latLngs) return latLngs;
|
|
19199
19158
|
if (Array.isArray(latLngs[0])) {
|
|
19200
19159
|
return latLngs.map((ring) => this.offsetPolygonCoordinates(ring, offsetLat, offsetLng));
|
|
@@ -19210,7 +19169,6 @@ class PolygonInteractionManager {
|
|
|
19210
19169
|
}
|
|
19211
19170
|
}
|
|
19212
19171
|
updateMarkersAndHoleLinesDuringDrag(polygon2, offsetLat, offsetLng) {
|
|
19213
|
-
console.log("PolygonInteractionManager updateMarkersAndHoleLinesDuringDrag");
|
|
19214
19172
|
try {
|
|
19215
19173
|
let featureGroup = null;
|
|
19216
19174
|
for (const fg of this.getFeatureGroups()) {
|
|
@@ -19267,7 +19225,6 @@ class PolygonInteractionManager {
|
|
|
19267
19225
|
}
|
|
19268
19226
|
}
|
|
19269
19227
|
async updatePolygonAfterDrag(polygon2) {
|
|
19270
|
-
console.log("PolygonInteractionManager updatePolygonAfterDrag");
|
|
19271
19228
|
try {
|
|
19272
19229
|
let featureGroup = null;
|
|
19273
19230
|
for (const fg of this.getFeatureGroups()) {
|
|
@@ -19301,7 +19258,6 @@ class PolygonInteractionManager {
|
|
|
19301
19258
|
}
|
|
19302
19259
|
detectModifierKey(event) {
|
|
19303
19260
|
var _a2, _b2;
|
|
19304
|
-
console.log("PolygonInteractionManager detectModifierKey");
|
|
19305
19261
|
if (!((_b2 = (_a2 = this.config.dragPolygons) == null ? void 0 : _a2.modifierSubtract) == null ? void 0 : _b2.enabled)) {
|
|
19306
19262
|
return false;
|
|
19307
19263
|
}
|
|
@@ -19317,7 +19273,6 @@ class PolygonInteractionManager {
|
|
|
19317
19273
|
}
|
|
19318
19274
|
}
|
|
19319
19275
|
setSubtractVisualMode(polygon2, enabled) {
|
|
19320
|
-
console.log("PolygonInteractionManager setSubtractVisualMode");
|
|
19321
19276
|
if (!polygon2 || !polygon2.setStyle) {
|
|
19322
19277
|
return;
|
|
19323
19278
|
}
|
|
@@ -19337,7 +19292,6 @@ class PolygonInteractionManager {
|
|
|
19337
19292
|
}
|
|
19338
19293
|
updateMarkerColorsForSubtractMode(polygon2, subtractMode) {
|
|
19339
19294
|
var _a2, _b2;
|
|
19340
|
-
console.log("PolygonInteractionManager updateMarkerColorsForSubtractMode");
|
|
19341
19295
|
try {
|
|
19342
19296
|
let featureGroup = null;
|
|
19343
19297
|
for (const fg of this.getFeatureGroups()) {
|
|
@@ -19383,7 +19337,6 @@ class PolygonInteractionManager {
|
|
|
19383
19337
|
}
|
|
19384
19338
|
}
|
|
19385
19339
|
handleModifierToggleDuringDrag(event) {
|
|
19386
|
-
console.log("PolygonInteractionManager handleModifierToggleDuringDrag");
|
|
19387
19340
|
const isModifierPressed = this.detectModifierKey(event);
|
|
19388
19341
|
this.currentModifierDragMode = isModifierPressed;
|
|
19389
19342
|
this.isModifierKeyHeld = isModifierPressed;
|
|
@@ -19392,11 +19345,9 @@ class PolygonInteractionManager {
|
|
|
19392
19345
|
}
|
|
19393
19346
|
}
|
|
19394
19347
|
isModifierDragActive() {
|
|
19395
|
-
console.log("PolygonInteractionManager isModifierDragActive");
|
|
19396
19348
|
return this.currentModifierDragMode;
|
|
19397
19349
|
}
|
|
19398
19350
|
performModifierSubtract(draggedGeoJSON, originalFeatureGroup) {
|
|
19399
|
-
console.log("PolygonInteractionManager performModifierSubtract");
|
|
19400
19351
|
try {
|
|
19401
19352
|
const draggedPolygon = this.turfHelper.getTurfPolygon(draggedGeoJSON);
|
|
19402
19353
|
const intersectingFeatureGroups = [];
|
|
@@ -19478,7 +19429,6 @@ class PolygonInteractionManager {
|
|
|
19478
19429
|
return !(bbox1[2] < bbox2[0] || bbox2[2] < bbox1[0] || bbox1[3] < bbox2[1] || bbox2[3] < bbox1[1]);
|
|
19479
19430
|
}
|
|
19480
19431
|
isModifierKeyPressed(event) {
|
|
19481
|
-
console.log("PolygonInteractionManager isModifierKeyPressed");
|
|
19482
19432
|
if (isTouchDevice()) {
|
|
19483
19433
|
return false;
|
|
19484
19434
|
}
|
|
@@ -19491,7 +19441,6 @@ class PolygonInteractionManager {
|
|
|
19491
19441
|
}
|
|
19492
19442
|
}
|
|
19493
19443
|
onMarkerHoverForEdgeDeletion(marker, isHovering) {
|
|
19494
|
-
console.log("PolygonInteractionManager onMarkerHoverForEdgeDeletion");
|
|
19495
19444
|
const element = marker.getElement();
|
|
19496
19445
|
if (!element) return;
|
|
19497
19446
|
if (isHovering) {
|
|
@@ -19544,7 +19493,6 @@ class PolygonInteractionManager {
|
|
|
19544
19493
|
}
|
|
19545
19494
|
// Helper methods
|
|
19546
19495
|
getMarkerIndex(latlngs, position) {
|
|
19547
|
-
console.log("PolygonInteractionManager getMarkerIndex");
|
|
19548
19496
|
const bounds = PolyDrawUtil.getBounds(latlngs, Math.sqrt(2) / 2);
|
|
19549
19497
|
const compass = new Compass(
|
|
19550
19498
|
bounds.getSouth(),
|
|
@@ -19563,7 +19511,6 @@ class PolygonInteractionManager {
|
|
|
19563
19511
|
return nearestPointIdx;
|
|
19564
19512
|
}
|
|
19565
19513
|
ensureMarkerSeparation(polygonLength, markers2) {
|
|
19566
|
-
console.log("PolygonInteractionManager ensureMarkerSeparation");
|
|
19567
19514
|
const enabledMarkers = [];
|
|
19568
19515
|
if (markers2.menu.enabled) {
|
|
19569
19516
|
enabledMarkers.push({ type: "menu", index: markers2.menu.index });
|
|
@@ -19606,7 +19553,6 @@ class PolygonInteractionManager {
|
|
|
19606
19553
|
};
|
|
19607
19554
|
}
|
|
19608
19555
|
findAlternativeMarkerPosition(polygonLength, originalIndex, usedIndices) {
|
|
19609
|
-
console.log("PolygonInteractionManager findAlternativeMarkerPosition");
|
|
19610
19556
|
const maxAttempts = polygonLength;
|
|
19611
19557
|
const step = Math.max(1, Math.floor(polygonLength / 8));
|
|
19612
19558
|
for (let attempt = 1; attempt < maxAttempts; attempt++) {
|
|
@@ -19628,15 +19574,12 @@ class PolygonInteractionManager {
|
|
|
19628
19574
|
return originalIndex;
|
|
19629
19575
|
}
|
|
19630
19576
|
createDivIcon(processedClasses) {
|
|
19631
|
-
console.log("PolygonInteractionManager createDivIcon");
|
|
19632
19577
|
return IconFactory.createDivIcon(processedClasses);
|
|
19633
19578
|
}
|
|
19634
19579
|
getLatLngInfoString(latlng) {
|
|
19635
|
-
console.log("PolygonInteractionManager getLatLngInfoString");
|
|
19636
19580
|
return "Latitude: " + latlng.lat + " Longitude: " + latlng.lng;
|
|
19637
19581
|
}
|
|
19638
19582
|
generateMenuMarkerPopup(latLngs, featureGroup) {
|
|
19639
|
-
console.log("PolygonInteractionManager generateMenuMarkerPopup");
|
|
19640
19583
|
const outerWrapper = document.createElement("div");
|
|
19641
19584
|
outerWrapper.classList.add("alter-marker-outer-wrapper");
|
|
19642
19585
|
const wrapper = document.createElement("div");
|
|
@@ -19757,16 +19700,16 @@ class PolygonInteractionManager {
|
|
|
19757
19700
|
btn.style.pointerEvents = "auto";
|
|
19758
19701
|
btn.addEventListener("click", (e) => e.stopPropagation());
|
|
19759
19702
|
});
|
|
19703
|
+
const isMobile = window.innerWidth <= 600;
|
|
19760
19704
|
const popup = L.popup({
|
|
19761
19705
|
closeButton: true,
|
|
19762
19706
|
autoClose: true,
|
|
19763
|
-
className:
|
|
19707
|
+
className: `menu-popup${isMobile ? " mobile-popup" : ""}`
|
|
19764
19708
|
}).setContent(outerWrapper);
|
|
19765
19709
|
this._openMenuPopup = popup;
|
|
19766
19710
|
return popup;
|
|
19767
19711
|
}
|
|
19768
19712
|
getPolygonGeoJSONFromFeatureGroup(featureGroup) {
|
|
19769
|
-
console.log("PolygonInteractionManager getPolygonGeoJSONFromFeatureGroup");
|
|
19770
19713
|
try {
|
|
19771
19714
|
let polygon2 = null;
|
|
19772
19715
|
featureGroup.eachLayer((layer) => {
|
|
@@ -19799,7 +19742,6 @@ class PolygonInteractionManager {
|
|
|
19799
19742
|
}
|
|
19800
19743
|
}
|
|
19801
19744
|
getTotalPolygonPerimeter(polygonGeoJSON) {
|
|
19802
|
-
console.log("PolygonInteractionManager getTotalPolygonPerimeter");
|
|
19803
19745
|
try {
|
|
19804
19746
|
if (!polygonGeoJSON || !polygonGeoJSON.geometry) {
|
|
19805
19747
|
return 0;
|
|
@@ -19843,7 +19785,6 @@ class PolygonInteractionManager {
|
|
|
19843
19785
|
}
|
|
19844
19786
|
}
|
|
19845
19787
|
generateInfoMarkerPopup(area2, perimeter) {
|
|
19846
|
-
console.log("PolygonInteractionManager generateInfoMarkerPopup");
|
|
19847
19788
|
const _perimeter = new Perimeter(perimeter, this.config);
|
|
19848
19789
|
const _area = new Area(area2, this.config);
|
|
19849
19790
|
const outerWrapper = document.createElement("div");
|
|
@@ -19871,10 +19812,11 @@ class PolygonInteractionManager {
|
|
|
19871
19812
|
btn.style.pointerEvents = "auto";
|
|
19872
19813
|
btn.addEventListener("click", (e) => e.stopPropagation());
|
|
19873
19814
|
});
|
|
19815
|
+
const isMobile = window.innerWidth <= 600;
|
|
19874
19816
|
const popup = L.popup({
|
|
19875
19817
|
closeButton: true,
|
|
19876
19818
|
autoClose: true,
|
|
19877
|
-
className:
|
|
19819
|
+
className: `info-popup${isMobile ? " mobile-popup" : ""}`
|
|
19878
19820
|
}).setContent(outerWrapper);
|
|
19879
19821
|
return popup;
|
|
19880
19822
|
}
|
|
@@ -20594,7 +20536,6 @@ class PolygonMutationManager {
|
|
|
20594
20536
|
}
|
|
20595
20537
|
class Polydraw extends L.Control {
|
|
20596
20538
|
constructor(options) {
|
|
20597
|
-
console.log("constructor");
|
|
20598
20539
|
super(options);
|
|
20599
20540
|
__publicField(this, "map");
|
|
20600
20541
|
__publicField(this, "tracer", {});
|
|
@@ -20620,7 +20561,6 @@ class Polydraw extends L.Control {
|
|
|
20620
20561
|
* Handle marker hover when modifier key is held - event handler version
|
|
20621
20562
|
*/
|
|
20622
20563
|
__publicField(this, "onMarkerHoverForEdgeDeletionEvent", (e) => {
|
|
20623
|
-
console.log("onMarkerHoverForEdgeDeletionEvent");
|
|
20624
20564
|
if (!this.isModifierKeyHeld) return;
|
|
20625
20565
|
const element = e.target;
|
|
20626
20566
|
if (element) {
|
|
@@ -20633,7 +20573,6 @@ class Polydraw extends L.Control {
|
|
|
20633
20573
|
* Handle marker leave when modifier key is held - event handler version
|
|
20634
20574
|
*/
|
|
20635
20575
|
__publicField(this, "onMarkerLeaveForEdgeDeletionEvent", (e) => {
|
|
20636
|
-
console.log("onMarkerLeaveForEdgeDeletionEvent");
|
|
20637
20576
|
const element = e.target;
|
|
20638
20577
|
if (element) {
|
|
20639
20578
|
element.style.backgroundColor = "";
|
|
@@ -20692,8 +20631,6 @@ class Polydraw extends L.Control {
|
|
|
20692
20631
|
if (L.Browser.touch && L.Browser.mobile) {
|
|
20693
20632
|
_map.tap = false;
|
|
20694
20633
|
}
|
|
20695
|
-
console.log("iOS touch workaround applied");
|
|
20696
|
-
console.log("onAdd");
|
|
20697
20634
|
this.map = _map;
|
|
20698
20635
|
const style = document.createElement("style");
|
|
20699
20636
|
style.innerHTML = `
|
|
@@ -20736,7 +20673,6 @@ class Polydraw extends L.Control {
|
|
|
20736
20673
|
this.updateActivateButtonIndicator();
|
|
20737
20674
|
};
|
|
20738
20675
|
const onDrawClick = (e) => {
|
|
20739
|
-
console.log("onDrawClick");
|
|
20740
20676
|
if (e) {
|
|
20741
20677
|
e.preventDefault();
|
|
20742
20678
|
e.stopPropagation();
|
|
@@ -20749,7 +20685,6 @@ class Polydraw extends L.Control {
|
|
|
20749
20685
|
this.polygonInformation.saveCurrentState();
|
|
20750
20686
|
};
|
|
20751
20687
|
const onSubtractClick = (e) => {
|
|
20752
|
-
console.log("onSubtractClick");
|
|
20753
20688
|
if (e) {
|
|
20754
20689
|
e.preventDefault();
|
|
20755
20690
|
e.stopPropagation();
|
|
@@ -20773,7 +20708,6 @@ class Polydraw extends L.Control {
|
|
|
20773
20708
|
this.removeAllFeatureGroups();
|
|
20774
20709
|
};
|
|
20775
20710
|
const onPointToPointClick = (e) => {
|
|
20776
|
-
console.log("onPointToPointClick");
|
|
20777
20711
|
if (e) {
|
|
20778
20712
|
e.preventDefault();
|
|
20779
20713
|
e.stopPropagation();
|
|
@@ -20825,7 +20759,6 @@ class Polydraw extends L.Control {
|
|
|
20825
20759
|
getFeatureGroups: () => this.arrayOfFeatureGroups
|
|
20826
20760
|
});
|
|
20827
20761
|
this.polygonMutationManager.on("polygonOperationComplete", (data) => {
|
|
20828
|
-
console.log("polygonOperationComplete");
|
|
20829
20762
|
this.updateActivateButtonIndicator();
|
|
20830
20763
|
this.modeManager.updateStateForMode(DrawMode.Off);
|
|
20831
20764
|
this.drawMode = DrawMode.Off;
|
|
@@ -20869,7 +20802,6 @@ class Polydraw extends L.Control {
|
|
|
20869
20802
|
return container;
|
|
20870
20803
|
}
|
|
20871
20804
|
addTo(map) {
|
|
20872
|
-
console.log("addTo");
|
|
20873
20805
|
super.addTo(map);
|
|
20874
20806
|
return this;
|
|
20875
20807
|
}
|
|
@@ -20877,7 +20809,6 @@ class Polydraw extends L.Control {
|
|
|
20877
20809
|
return this.arrayOfFeatureGroups;
|
|
20878
20810
|
}
|
|
20879
20811
|
onRemove(_map) {
|
|
20880
|
-
console.log("onRemove");
|
|
20881
20812
|
this.removeKeyboardHandlers();
|
|
20882
20813
|
if (this.tracer) {
|
|
20883
20814
|
this.map.removeLayer(this.tracer);
|
|
@@ -20885,7 +20816,6 @@ class Polydraw extends L.Control {
|
|
|
20885
20816
|
this.removeAllFeatureGroups();
|
|
20886
20817
|
}
|
|
20887
20818
|
async addPredefinedPolygon(geographicBorders, options) {
|
|
20888
|
-
console.log("addPredefinedPolygon");
|
|
20889
20819
|
if (!geographicBorders || geographicBorders.length === 0) {
|
|
20890
20820
|
throw new Error("Cannot add empty polygon array");
|
|
20891
20821
|
}
|
|
@@ -20922,7 +20852,6 @@ class Polydraw extends L.Control {
|
|
|
20922
20852
|
}
|
|
20923
20853
|
}
|
|
20924
20854
|
setDrawMode(mode) {
|
|
20925
|
-
console.log("setDrawMode");
|
|
20926
20855
|
const previousMode = this.drawMode;
|
|
20927
20856
|
this.drawMode = mode;
|
|
20928
20857
|
this.modeManager.updateStateForMode(mode);
|
|
@@ -20979,7 +20908,6 @@ class Polydraw extends L.Control {
|
|
|
20979
20908
|
}
|
|
20980
20909
|
}
|
|
20981
20910
|
getDrawMode() {
|
|
20982
|
-
console.log("getDrawMode");
|
|
20983
20911
|
return this.modeManager.getCurrentMode();
|
|
20984
20912
|
}
|
|
20985
20913
|
on(event, callback) {
|
|
@@ -20989,7 +20917,6 @@ class Polydraw extends L.Control {
|
|
|
20989
20917
|
this.eventManager.off(event, callback);
|
|
20990
20918
|
}
|
|
20991
20919
|
emitDrawModeChanged() {
|
|
20992
|
-
console.log("emitDrawModeChanged");
|
|
20993
20920
|
this.eventManager.emit("polydraw:mode:change", {
|
|
20994
20921
|
mode: this.modeManager.getCurrentMode()
|
|
20995
20922
|
});
|
|
@@ -21001,7 +20928,6 @@ class Polydraw extends L.Control {
|
|
|
21001
20928
|
* Update the draggable state of all existing markers when draw mode changes
|
|
21002
20929
|
*/
|
|
21003
20930
|
updateMarkerDraggableState() {
|
|
21004
|
-
console.log("updateMarkerDraggableState");
|
|
21005
20931
|
const shouldBeDraggable = this.modeManager.canPerformAction("markerDrag");
|
|
21006
20932
|
this.arrayOfFeatureGroups.forEach((featureGroup) => {
|
|
21007
20933
|
featureGroup.eachLayer((layer) => {
|
|
@@ -21023,7 +20949,6 @@ class Polydraw extends L.Control {
|
|
|
21023
20949
|
});
|
|
21024
20950
|
}
|
|
21025
20951
|
removeAllFeatureGroups() {
|
|
21026
|
-
console.log("removeAllFeatureGroups");
|
|
21027
20952
|
this.arrayOfFeatureGroups.forEach((featureGroups) => {
|
|
21028
20953
|
try {
|
|
21029
20954
|
this.map.removeLayer(featureGroups);
|
|
@@ -21036,22 +20961,18 @@ class Polydraw extends L.Control {
|
|
|
21036
20961
|
this.updateActivateButtonIndicator();
|
|
21037
20962
|
}
|
|
21038
20963
|
stopDraw() {
|
|
21039
|
-
console.log("stopDraw");
|
|
21040
20964
|
this.resetTracker();
|
|
21041
20965
|
this.drawStartedEvents(false);
|
|
21042
20966
|
}
|
|
21043
20967
|
setLeafletMapEvents(enableDragging, enableDoubleClickZoom, enableScrollWheelZoom) {
|
|
21044
|
-
console.log("setLeafletMapEvents");
|
|
21045
20968
|
enableDragging ? this.map.dragging.enable() : this.map.dragging.disable();
|
|
21046
20969
|
enableDoubleClickZoom ? this.map.doubleClickZoom.enable() : this.map.doubleClickZoom.disable();
|
|
21047
20970
|
enableScrollWheelZoom ? this.map.scrollWheelZoom.enable() : this.map.scrollWheelZoom.disable();
|
|
21048
20971
|
}
|
|
21049
20972
|
resetTracker() {
|
|
21050
|
-
console.log("resetTracker");
|
|
21051
20973
|
this.tracer.setLatLngs([]);
|
|
21052
20974
|
}
|
|
21053
20975
|
drawStartedEvents(onoff) {
|
|
21054
|
-
console.log("drawStartedEvents");
|
|
21055
20976
|
const onoroff = onoff ? "on" : "off";
|
|
21056
20977
|
this.map[onoroff]("mousemove", this.mouseMove, this);
|
|
21057
20978
|
this.map[onoroff]("mouseup", this.mouseUpLeave, this);
|
|
@@ -21070,7 +20991,6 @@ class Polydraw extends L.Control {
|
|
|
21070
20991
|
}
|
|
21071
20992
|
}
|
|
21072
20993
|
mouseMove(event) {
|
|
21073
|
-
console.log("mouseMove");
|
|
21074
20994
|
if ("cancelable" in event && event.cancelable) {
|
|
21075
20995
|
event.preventDefault();
|
|
21076
20996
|
}
|
|
@@ -21115,7 +21035,6 @@ class Polydraw extends L.Control {
|
|
|
21115
21035
|
if ("cancelable" in event && event.cancelable) {
|
|
21116
21036
|
event.preventDefault();
|
|
21117
21037
|
}
|
|
21118
|
-
console.log("mouseUpLeave");
|
|
21119
21038
|
this.polygonInformation.deletePolygonInformationStorage();
|
|
21120
21039
|
const tracerGeoJSON = this.tracer.toGeoJSON();
|
|
21121
21040
|
if (!tracerGeoJSON || !tracerGeoJSON.geometry || !tracerGeoJSON.geometry.coordinates || tracerGeoJSON.geometry.coordinates.length < 3) {
|
|
@@ -21162,7 +21081,6 @@ class Polydraw extends L.Control {
|
|
|
21162
21081
|
this.polygonInformation.createPolygonInformationStorage(this.arrayOfFeatureGroups);
|
|
21163
21082
|
}
|
|
21164
21083
|
events(onoff) {
|
|
21165
|
-
console.log("events");
|
|
21166
21084
|
const onoroff = onoff ? "on" : "off";
|
|
21167
21085
|
this.map[onoroff]("mousedown", this.mouseDown, this);
|
|
21168
21086
|
this.map[onoroff]("dblclick", this.handleDoubleClick, this);
|
|
@@ -21179,7 +21097,6 @@ class Polydraw extends L.Control {
|
|
|
21179
21097
|
if ("cancelable" in event && event.cancelable) {
|
|
21180
21098
|
event.preventDefault();
|
|
21181
21099
|
}
|
|
21182
|
-
console.log("mouseDown");
|
|
21183
21100
|
if (this.modeManager.isInOffMode()) {
|
|
21184
21101
|
return;
|
|
21185
21102
|
}
|
|
@@ -21203,22 +21120,18 @@ class Polydraw extends L.Control {
|
|
|
21203
21120
|
this.startDraw();
|
|
21204
21121
|
}
|
|
21205
21122
|
startDraw() {
|
|
21206
|
-
console.log("startDraw");
|
|
21207
21123
|
this.drawStartedEvents(true);
|
|
21208
21124
|
}
|
|
21209
21125
|
setupKeyboardHandlers() {
|
|
21210
|
-
console.log("setupKeyboardHandlers");
|
|
21211
21126
|
this._boundKeyUpHandler = this.handleKeyUp.bind(this);
|
|
21212
21127
|
document.addEventListener("keydown", this._boundKeyDownHandler);
|
|
21213
21128
|
document.addEventListener("keyup", this._boundKeyUpHandler);
|
|
21214
21129
|
}
|
|
21215
21130
|
removeKeyboardHandlers() {
|
|
21216
|
-
console.log("removeKeyboardHandlers");
|
|
21217
21131
|
document.removeEventListener("keydown", this._boundKeyDownHandler);
|
|
21218
21132
|
document.removeEventListener("keyup", this._boundKeyUpHandler);
|
|
21219
21133
|
}
|
|
21220
21134
|
handleKeyDown(e) {
|
|
21221
|
-
console.log("handleKeyDown");
|
|
21222
21135
|
if (e.key === "Escape") {
|
|
21223
21136
|
if (this.modeManager.getCurrentMode() === DrawMode.PointToPoint) {
|
|
21224
21137
|
this.polygonDrawManager.cancelPointToPointDrawing();
|
|
@@ -21232,7 +21145,6 @@ class Polydraw extends L.Control {
|
|
|
21232
21145
|
}
|
|
21233
21146
|
}
|
|
21234
21147
|
handleKeyUp(e) {
|
|
21235
|
-
console.log("handleKeyUp");
|
|
21236
21148
|
const isModifierPressed = this.isModifierKeyPressed(e);
|
|
21237
21149
|
if (!isModifierPressed && this.isModifierKeyHeld) {
|
|
21238
21150
|
this.isModifierKeyHeld = false;
|
|
@@ -21244,7 +21156,6 @@ class Polydraw extends L.Control {
|
|
|
21244
21156
|
* Update all markers to show/hide edge deletion visual feedback
|
|
21245
21157
|
*/
|
|
21246
21158
|
updateAllMarkersForEdgeDeletion(showFeedback) {
|
|
21247
|
-
console.log("updateAllMarkersForEdgeDeletion");
|
|
21248
21159
|
this.arrayOfFeatureGroups.forEach((featureGroup) => {
|
|
21249
21160
|
featureGroup.eachLayer((layer) => {
|
|
21250
21161
|
if (layer instanceof L.Marker) {
|
|
@@ -21257,7 +21168,6 @@ class Polydraw extends L.Control {
|
|
|
21257
21168
|
* Update individual marker for edge deletion visual feedback
|
|
21258
21169
|
*/
|
|
21259
21170
|
updateMarkerForEdgeDeletion(marker, showFeedback) {
|
|
21260
|
-
console.log("updateMarkerForEdgeDeletion");
|
|
21261
21171
|
const element = marker.getElement();
|
|
21262
21172
|
if (!element) return;
|
|
21263
21173
|
if (showFeedback) {
|
|
@@ -21271,7 +21181,6 @@ class Polydraw extends L.Control {
|
|
|
21271
21181
|
}
|
|
21272
21182
|
}
|
|
21273
21183
|
handleDoubleClick(e) {
|
|
21274
|
-
console.log("handleDoubleClick");
|
|
21275
21184
|
if (this.modeManager.getCurrentMode() !== DrawMode.PointToPoint) {
|
|
21276
21185
|
return;
|
|
21277
21186
|
}
|
|
@@ -21281,7 +21190,6 @@ class Polydraw extends L.Control {
|
|
|
21281
21190
|
* Detect if modifier key is pressed (Ctrl on Windows/Linux, Cmd on Mac)
|
|
21282
21191
|
*/
|
|
21283
21192
|
isModifierKeyPressed(event) {
|
|
21284
|
-
console.log("isModifierKeyPressed");
|
|
21285
21193
|
const userAgent = navigator.userAgent.toLowerCase();
|
|
21286
21194
|
const isMac = userAgent.includes("mac");
|
|
21287
21195
|
if (isMac) {
|