Files
dcs_liberation/client/src/components/waypointdebugzones/WaypointDebugZonesControls.tsx
Dan Albert a70ab8cc1d Add waypoint debug layers to the new map.
This is now feature complete with the exception of the ruler, none of
which seem to work with react. Someone that understands JS packaging
better than I do (which is a very low bar) will need to have a look.

https://github.com/dcs-liberation/dcs_liberation/issues/2039
2022-03-07 17:28:43 -08:00

31 lines
950 B
TypeScript

import { selectSelectedFlightId } from "../../api/flightsSlice";
import { useAppSelector } from "../../app/hooks";
import { HoldZonesLayer } from "./HoldZones";
import { IpZonesLayer } from "./IpZones";
import { JoinZonesLayer } from "./JoinZones";
import { LayersControl } from "react-leaflet";
const ENABLE_EXPENSIVE_DEBUG_TOOLS = false;
export function WaypointDebugZonesControls() {
const selectedFlightId = useAppSelector(selectSelectedFlightId);
if (!ENABLE_EXPENSIVE_DEBUG_TOOLS) {
return <></>;
}
return (
<>
<LayersControl.Overlay name="IP zones">
<IpZonesLayer flightId={selectedFlightId} />
</LayersControl.Overlay>
<LayersControl.Overlay name="Join zones">
<JoinZonesLayer flightId={selectedFlightId} />
</LayersControl.Overlay>
<LayersControl.Overlay name="Hold zones">
<HoldZonesLayer flightId={selectedFlightId} />
</LayersControl.Overlay>
</>
);
}