Skip to content

fix: ensure prior drawingSource features are cleared when entering drawMode#50

Merged
jessicamcinchak merged 3 commits intomainfrom
jess/bug-clear-prior-drawings
Aug 27, 2021
Merged

fix: ensure prior drawingSource features are cleared when entering drawMode#50
jessicamcinchak merged 3 commits intomainfrom
jess/bug-clear-prior-drawings

Conversation

@jessicamcinchak
Copy link
Copy Markdown
Member

Fixes #46

@netlify
Copy link
Copy Markdown

netlify Bot commented Aug 20, 2021

✔️ 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

@jessicamcinchak jessicamcinchak requested a review from a team August 24, 2021 16:11
Copy link
Copy Markdown
Contributor

@gunar gunar left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Love how organized you are with GitHub issues and PRs ✨

Comment thread src/my-map.ts
}

if (this.drawMode) {
drawingSource.clear();
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 !

@jessicamcinchak jessicamcinchak merged commit 5881515 into main Aug 27, 2021
@jessicamcinchak jessicamcinchak deleted the jess/bug-clear-prior-drawings branch August 27, 2021 06:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Empty drawing layer features before each draw

2 participants