Improve IP selection near threat zone centers.

Fixes https://github.com/dcs-liberation/dcs_liberation/issues/2754.
This commit is contained in:
Dan Albert
2023-07-11 21:55:40 -07:00
committed by Raffson
parent f89ac52bf3
commit 12cdb8646c
5 changed files with 89 additions and 8 deletions

View File

@@ -384,6 +384,8 @@ export type IpZones = {
ipBubble: LatLng[][];
permissibleZone: LatLng[][];
safeZones: LatLng[][][];
preferredThreatenedZones: LatLng[][][];
tolerableThreatenedLines: LatLng[][];
};
export type JoinZones = {
homeBubble: LatLng[][];

View File

@@ -1,5 +1,5 @@
import { useGetDebugIpZonesQuery } from "../../api/liberationApi";
import { LayerGroup, Polygon } from "react-leaflet";
import { LayerGroup, Polygon, Polyline } from "react-leaflet";
interface IpZonesProps {
flightId: string;
@@ -56,6 +56,29 @@ function IpZones(props: IpZonesProps) {
/>
);
})}
{data.preferredThreatenedZones.map((zone, idx) => {
return (
<Polygon
key={idx}
positions={zone}
color="#fe7d0a"
fillOpacity={0.1}
interactive={false}
/>
);
})}
{data.tolerableThreatenedLines.map((line, idx) => {
return (
<Polyline
key={idx}
positions={line}
color="#80BA80"
interactive={false}
/>
);
})}
</>
);
}