debug road mission cartable area view

This commit is contained in:
2025-12-17 14:47:06 +03:30
parent 05d5c11c4e
commit 633da895c2
10 changed files with 270 additions and 141 deletions

View File

@@ -6,10 +6,15 @@ import ShowBound from "../showBound";
import L from "leaflet";
const ShowArea = ({ area }) => {
const latLngs = useMemo(() => {
return area.coordinates.map(([lng, lat]) => [lat, lng]);
}, [area.coordinates]);
const bound = useMemo(
() => (area.type == "polygon" ? L.polygon([...area.coordinates]) : L.polyline([...area.coordinates])),
[area]
() => (area.type === "polygon" ? L.polygon(latLngs) : L.polyline(latLngs)),
[area.type, latLngs]
);
const [openAreaDialog, setOpenAreaDialog] = useState(false);
return (