MCPcopy Create free account
hub / github.com/Thanas-R/Virdis / handleStyleChange

Function handleStyleChange

src/components/MapView.tsx:369–377  ·  view source on GitHub ↗
(style: "dark" | "satellite")

Source from the content-addressed store, hash-verified

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]);

Callers

nothing calls this directly

Calls 1

hideExtraLabelsFunction · 0.85

Tested by

no test coverage detected