Skip to content

Commit

Permalink
Clear MapSelection selection layer if geometry type changes
Browse files Browse the repository at this point in the history
  • Loading branch information
manisandro committed Feb 21, 2024
1 parent 96ca7dc commit 90c23bd
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions components/MapSelection.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,9 @@ class MapSelection extends React.Component {
}
}
componentDidUpdate(prevProps, prevState) {
if (this.props.geomType !== prevProps.geomType) {
this.selectionLayer.getSource().clear();
}
if ((this.props.active && !prevProps.active) || (this.props.active && this.props.geomType !== prevProps.geomType)) {
this.addDrawInteraction();
} else if (!this.props.active && prevProps.active) {
Expand Down

0 comments on commit 90c23bd

Please sign in to comment.