fix: ensure prior drawingSource features are cleared when entering drawMode#50
Conversation
|
✔️ Deploy Preview for oslmap ready! 🔨 Explore the source changes: 0650e02 🔍 Inspect the deploy log: https://app.netlify.com/sites/oslmap/deploys/612889d6fff576000702d629 😎 Browse the preview: https://deploy-preview-50--oslmap.netlify.app |
gunar
left a comment
There was a problem hiding this comment.
Love how organized you are with GitHub issues and PRs ✨
| } | ||
|
|
||
| if (this.drawMode) { | ||
| drawingSource.clear(); |
There was a problem hiding this comment.
Is imperative the only way to solve this? Just checking. And if then, do you think it might be interesting to add a comment here explaining why .clear() is even necessary at this point?
There was a problem hiding this comment.
This is the most common way I've seen to address this per the OL docs - we also do the same in the fetch method for features, explicitly empty the existing source before we add newly fetched features to it.
Comment added via 0650e02 !
Fixes #46