Clean up leaflet polygon API surface.

This commit is contained in:
Dan Albert
2022-03-06 23:25:25 -08:00
parent 15176223fa
commit 6ee235545f
10 changed files with 53 additions and 65 deletions

View File

@@ -1,7 +1,6 @@
import { Flight } from "../../api/flight";
import { useGetCommitBoundaryForFlightQuery } from "../../api/liberationApi";
import WaypointMarker from "../waypointmarker";
import { LatLng } from "leaflet";
import { ReactElement } from "react";
import { Polyline } from "react-leaflet";
@@ -83,15 +82,8 @@ function CommitBoundary(props: CommitBoundaryProps) {
);
return <></>;
}
// TODO: Fix the response model and clean up.
const positions = data.map(([lat, lng]) => new LatLng(lat, lng));
return (
<Polyline
positions={positions}
color="#ffff00"
weight={1}
interactive={false}
/>
<Polyline positions={data} color="#ffff00" weight={1} interactive={false} />
);
}