Skip to content

Commit

Permalink
Merge pull request #40 from RENCI/remove-bullseyes
Browse files Browse the repository at this point in the history
Clear out the bullseye map layers
  • Loading branch information
lstillwe authored May 8, 2024
2 parents 05a6356 + d8a61dc commit aa34d81
Showing 1 changed file with 14 additions and 2 deletions.
16 changes: 14 additions & 2 deletions src/components/trays/observations/removeObservations.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,25 @@ import {useLayers} from "@context";
export const RemoveObservations = () => {
// get references to the observation data/list
const {
map,
selectedObservations,
setSelectedObservations
} = useLayers();

// remove the observation selections from state
/**
* remove the observation selections from state and map
*/
function removeAllObservations() {
// remove all items from the data list
// remove all the targets on the map
map.eachLayer((layer) => {
// if this is an observation selection marker
if (layer.options && layer.options.pane === "markerPane") {
// remove the layer
map.removeLayer(layer);
}
});

// remove all the dialog items from the data list
setSelectedObservations(selectedObservations.filter(item => item === undefined));
}

Expand Down

0 comments on commit aa34d81

Please sign in to comment.