Added ability to box select with long press

This commit is contained in:
Pax1601
2024-07-07 19:10:02 +02:00
parent fbc22676c5
commit 1dceb0b421
5 changed files with 52 additions and 24 deletions

View File

@@ -7,9 +7,7 @@ import {
faEllipsisV,
faCog,
faQuestionCircle,
faPlusSquare,
faBox,
faObjectGroup,
faPlusSquare
} from "@fortawesome/free-solid-svg-icons";
import { EventsConsumer } from "../../eventscontext";
import { StateConsumer } from "../../statecontext";
@@ -73,16 +71,6 @@ export function SideBar() {
icon={faPencil}
tooltip="Hide/show drawing menu"
></OlStateButton>
<OlStateButton
onClick={() => {
document.dispatchEvent(
new CustomEvent("mapForceBoxSelect")
);
}}
checked={appState.mapBoxSelection}
icon={faObjectGroup}
tooltip="Enable box selection on the map"
></OlStateButton>
</div>
</div>
<div className="flex w-16 flex-wrap content-end justify-center p-4">

View File

@@ -117,6 +117,9 @@ export function UnitMouseControlBar(props: {}) {
});
} else {
setActiveContextAction(null);
getApp().getMap().setState(CONTEXT_ACTION, {
contextAction: null,
});
}
}
}}