Skip to content

Commit

Permalink
Handle case when a feature is not completed
Browse files Browse the repository at this point in the history
Signed-off-by: Daniel Kastl <[email protected]>
  • Loading branch information
dkastl committed Jun 4, 2024
1 parent be2a79d commit 0a6ae79
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions src/components/gtt-client/openlayers/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -226,8 +226,16 @@ export function setControls(types: Array<string>) {
})

draw.on('change:active', evt => {
tooltip.removeFeature()
})
// If the Draw interaction is deactivated
if (!evt.target.getActive()) {
// Reset the style of existing features
this.vector.getSource().getFeatures().forEach((feature: any) => {
feature.setStyle(null); // Reset the style to the default style
});
}

tooltip.removeFeature();
});

draw.on('drawend', evt => {
tooltip.removeFeature()
Expand Down

0 comments on commit 0a6ae79

Please sign in to comment.