Skip to content

Commit

Permalink
Simplify event listener method
Browse files Browse the repository at this point in the history
  • Loading branch information
lehecht committed Aug 9, 2023
1 parent b5078d1 commit af7dfc3
Showing 1 changed file with 3 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -533,13 +533,12 @@ export default {
}, removeCallback);
} else {
let source = this.annotationSource;
source.once('change', (evtChange) => {
if (evtChange.target.getState() === 'ready' && source.hasFeature(e.feature)) {
source.once('change', () => {
if (source.hasFeature(e.feature)) {
source.removeFeature(e.feature);
this.$emit('has-invalid-shape', e.feature.getGeometry().getType());
}
});
this.$emit('has-invalid-shape', e.feature.getGeometry().getType());
}
},
hasValidPoints(e) {
Expand Down

0 comments on commit af7dfc3

Please sign in to comment.