Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

make sure addfeature is only called on readd #893

Merged
merged 2 commits into from
Jan 5, 2017

Conversation

jgravois
Copy link
Contributor

resolves #886

@patrickarlt
Copy link
Contributor

@jgravois I feel like we should prevent the problem (why is the event firing twice) rather then apply a solution (force feature to only be added once). I can try to find some time to debug why this happens.

@jgravois
Copy link
Contributor Author

jgravois commented Dec 2, 2016

agreed.

I took a stab at that initially but i couldn't quite wrap my brain around the internal logic and sequence of events when a fresh filter is applied in a real world scenario.

when I updated an existing test to start counting the number of events fired I expected it to trap the bug the user reported, but the issue isn't reproducible when raw features are fed in manually via createLayers() at all.

@patrickarlt
Copy link
Contributor

@jgravois Looks like @goldenlimit might have figured this out... #886 (comment)

@jgravois jgravois changed the title make sure addfeature is only called once make sure addfeature is only called on readd Dec 30, 2016
@jgravois
Copy link
Contributor Author

jgravois commented Dec 30, 2016

@goldenlimit was right.

the best course of action is to stop firing addfeature when layers are created entirely. this allows us to support the use case described in #788 and avoid the bug reported in #886.

since i never updated the API reference documentation to mention that addfeature was temporarily triggered when loading features for the first time, arguably what i'm now proposing isn't even a breaking change.

@jgravois jgravois merged commit 6d7cdc6 into Esri:master Jan 5, 2017
@jgravois jgravois deleted the patch886 branch November 29, 2017 21:27
jgravois added a commit to jgravois/esri-leaflet that referenced this pull request Apr 23, 2022
* make sure addfeature is only called once

* create OR add
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.

Calling setWhere fires the addfeature event twice.
2 participants