feat: implement boundary tracing feature for polygon drawing with Shift+T shortcut

This commit is contained in:
taDuc
2026-06-05 02:41:05 +07:00
parent e9657a4003
commit 61949e7149
10 changed files with 1527 additions and 98 deletions
+3 -2
View File
@@ -132,6 +132,7 @@ export function useMapInteraction({
}, [mode, mapRef]);
const setupMapInteractions = (map: maplibregl.Map) => {
(map as any)._renderDraftRef = renderDraftRef;
const drawingEngine = initDrawing(
map,
() => modeRef.current,
@@ -163,7 +164,7 @@ export function useMapInteraction({
onDeleteRef.current?.(id);
},
(feature) => {
const rawId = feature.id ?? feature.properties?.id;
const rawId = feature.properties?.id ?? feature.id;
const originalFeature = renderDraftRef.current.features.find(
(item) => String(item.properties.id) === String(rawId)
);
@@ -206,7 +207,7 @@ export function useMapInteraction({
},
(feature) => {
if (!onAddFeatureToProjectRef?.current) return;
const rawId = feature.id ?? feature.properties?.id;
const rawId = feature.properties?.id ?? feature.id;
if (rawId === undefined || rawId === null) return;
const originalFeature = renderDraftRef.current.features.find(