Skip to content

Commit

Permalink
prevent empty plot window
Browse files Browse the repository at this point in the history
  • Loading branch information
JustinElms committed Jan 9, 2025
1 parent 9b181f5 commit c7caa29
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion oceannavigator/frontend/src/components/map/Map.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -414,8 +414,12 @@ const Map = forwardRef((props, ref) => {
});

newSelect.on("select", function (e) {
let shiftHeld = e.mapBrowserEvent.originalEvent.shiftKey;
let selectedFeatures = this.getFeatures();
if (selectedFeatures.getLength() === 0) {
return;
}

let shiftHeld = e.mapBrowserEvent.originalEvent.shiftKey;
if (shiftHeld && e.selected[0].get("type") == "point") {
props.updateState(["multiSelect"], true);
}
Expand All @@ -429,6 +433,7 @@ const Map = forwardRef((props, ref) => {
if (e.selected.length == 0) {
props.action("point", props.vectorCoordinates);
}

pushSelection(selectedFeatures);

if (e.selected[0].get("type") == "area") {
Expand Down

0 comments on commit c7caa29

Please sign in to comment.