debug road mission cartable area view
This commit is contained in:
@@ -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 (
|
||||
|
||||
Reference in New Issue
Block a user