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

Race condition loading shapes #749

Merged
merged 4 commits into from
Apr 1, 2018

Conversation

nigelsim
Copy link
Contributor

@nigelsim nigelsim commented Mar 5, 2018

As outlined in my support request, we are unable to make Mapbox Draw correctly render features added before the control has fully loaded, but there are no events or otherwise to properly indicate that the control is ready.

This PR forces the ctx.store to be dirty when doing the initial rendering following adding its layers.

The issue is that the render cleanup() function is being called even if the map isn't ready yet, and this function sets store.isDirty=false, meaning that any unrendered features are ignored.

I've also changed the order of operations for the draw.render event for a similar reason, so that changes made to the draw instance in response to this event aren't immediately forgotten.

This means that the draw control is in its final state when the event is fired
so that it is safe for anything responding to the event to make changes to
the draw instance
@nigelsim
Copy link
Contributor Author

nigelsim commented Mar 5, 2018

This may resolve #745 and #724

@mcwhittemore
Copy link
Contributor

@nigelsim - sorry for the delayed follow up. I got a chance to sit down with this today and all looks well. I'm working on rolling a new release and show have this out shortly.

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.

2 participants