feat: Implement zone management features including creation, deletion, and updates

- Added zone handling in the Line component for removing and updating zones based on points.
- Enhanced Point component to support snapping and updating zone positions.
- Introduced zone-related API calls for upserting and deleting zones.
- Updated zone store to manage zones more effectively, including methods for removing zones by points and getting zones by point IDs.
- Improved zone instance rendering to handle dynamic point connections.
- Refactored zone creation logic to allow for better interaction and snapping behavior.
- Updated API endpoints for zone operations to use version 1 of the API.
This commit is contained in:
2025-06-30 12:22:42 +05:30
parent 90df6c2b01
commit 7124a819b6
18 changed files with 601 additions and 697 deletions

View File

@@ -85,9 +85,12 @@ export function useWallClassification(walls: Walls) {
}));
}
const allCoords = mergedLineStrings.flatMap(ls => ls.geometry.coordinates);
const uniqueCoords = Array.from(new Set(allCoords.map(coord => coord.join(','))));
if (uniqueCoords.length < 4) return [];
const lineStrings = turf.featureCollection(mergedLineStrings);
// Now polygonize merged line strings
const polygons = turf.polygonize(lineStrings);
const rooms: Point[][] = [];