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

Automatically aborts adding additional markers for an ongoing addLayers call when the clearLayers function is called. #816

Open
wants to merge 4 commits into
base: master
Choose a base branch
from

Conversation

frenomus
Copy link

The main use case for this is when you are dynamically filtering markers that are being added into the cluster layer using chunked loading. With large marker sets it is possible for the filter conditions to change mid importation.

Previously, calling the clearLayers function would only clear markers already added. If the addLayers function was currently importing markers these would be added after the clearLayers function was called resulting in an unexpected state.

This PR essentially keeps a track of the number of times the clearLayers function was called, and aborts an addLayers process if it began when the call count was less than the current call count of clearLayers.

@frenomus frenomus changed the title Automatically aborts adding additional markers for an ongoing addLayers calls when the clearLayers function is called. Automatically aborts adding additional markers for an ongoing addLayers call when the clearLayers function is called. Aug 11, 2017
@danzel
Copy link
Member

danzel commented Aug 13, 2017

Could we get a test for this please?

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