mirror of
https://github.com/dcs-liberation/dcs_liberation.git
synced 2025-11-10 14:22:26 +00:00
This is in need of some serious refactoring so that https://github.com/dcs-liberation/dcs_liberation/issues/2388 can be fixed.
28 lines
962 B
TypeScript
28 lines
962 B
TypeScript
import { ControlPoint } from "../../api/_liberationApi";
|
|
import { makeLocationMarkerEventHandlers } from "./EventHandlers";
|
|
import { iconForControlPoint } from "./Icons";
|
|
import LocationTooltipText from "./LocationTooltipText";
|
|
import { Marker, Tooltip } from "react-leaflet";
|
|
|
|
interface StaticControlPointProps {
|
|
controlPoint: ControlPoint;
|
|
}
|
|
|
|
export const StaticControlPoint = (props: StaticControlPointProps) => {
|
|
return (
|
|
<Marker
|
|
position={props.controlPoint.position}
|
|
icon={iconForControlPoint(props.controlPoint)}
|
|
// We might draw other markers on top of the CP. The tooltips from the
|
|
// other markers are helpful so we want to keep them, but make sure the CP
|
|
// is always the clickable thing.
|
|
zIndexOffset={1000}
|
|
eventHandlers={makeLocationMarkerEventHandlers(props.controlPoint)}
|
|
>
|
|
<Tooltip>
|
|
<LocationTooltipText name={props.controlPoint.name} />
|
|
</Tooltip>
|
|
</Marker>
|
|
);
|
|
};
|