(style: "dark" | "satellite")
| 367 | }); |
| 368 | marker.on("dragend", () => { |
| 369 | const ll = marker.getLngLat(); |
| 370 | const nc = [...currentCoords]; |
| 371 | nc[i] = [ll.lng, ll.lat]; |
| 372 | if (i === 0) nc[nc.length - 1] = [ll.lng, ll.lat]; |
| 373 | onUpdateFieldRef.current?.({ ...field, coordinates: [nc] as [number, number][][] }); |
| 374 | }); |
| 375 | editMarkersRef.current.push(marker); |
| 376 | }); |
| 377 | const handleKeyDown = (e: KeyboardEvent) => { if (e.key === "Enter" || e.key === "Escape") onCancelEditBoundary?.(); }; |
| 378 | document.addEventListener("keydown", handleKeyDown); |
| 379 | return () => { editMarkersRef.current.forEach((m) => m.remove()); editMarkersRef.current = []; document.removeEventListener("keydown", handleKeyDown); }; |
| 380 | }, [editBoundaryFieldId, mapLoaded, allFields, onCancelEditBoundary]); |
nothing calls this directly
no test coverage detected