Update the react map for some new events.

This commit is contained in:
Dan Albert
2022-03-03 23:31:07 -08:00
parent 4539e91fa9
commit 92236a5bc3
16 changed files with 145 additions and 65 deletions

View File

@@ -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>