mirror of
https://github.com/dcs-retribution/dcs-retribution.git
synced 2025-11-10 15:41:24 +00:00
Update the react map for some new events.
This commit is contained in:
@@ -3,6 +3,7 @@ import { Marker, Tooltip } from "react-leaflet";
|
||||
|
||||
import { ControlPoint as ControlPointModel } from "../../api/controlpoint";
|
||||
import { Symbol as MilSymbol } from "milsymbol";
|
||||
import backend from "../../api/backend";
|
||||
|
||||
function iconForControlPoint(cp: ControlPointModel) {
|
||||
const symbol = new MilSymbol(cp.sidc, {
|
||||
@@ -29,6 +30,16 @@ export default function ControlPoint(props: ControlPointProps) {
|
||||
// other markers are helpful so we want to keep them, but make sure the CP
|
||||
// is always the clickable thing.
|
||||
zIndexOffset={1000}
|
||||
eventHandlers={{
|
||||
click: () => {
|
||||
backend.post(`/qt/info/control-point/${props.controlPoint.id}`);
|
||||
},
|
||||
contextmenu: () => {
|
||||
backend.post(
|
||||
`/qt/create-package/control-point/${props.controlPoint.id}`
|
||||
);
|
||||
},
|
||||
}}
|
||||
>
|
||||
<Tooltip>
|
||||
<h3 style={{ margin: 0 }}>{props.controlPoint.name}</h3>
|
||||
|
||||
Reference in New Issue
Block a user