Skip to content

Fix race condition with cluster layer #1390

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

Merged
merged 1 commit into from
Nov 7, 2023
Merged

Conversation

yohanboniface
Copy link
Member

This occurs when the cluster layer has a min/maxZoom defined, the map is loaded inside this zoom range BUT the defaultView=data, and would immediately change the current zoom to a value outside this range.

In this case, the datalayer is added to the map, then the data is requested, then the map view is recomputed with the full data bounds.

There may be a better fix on our side, but given there is async in the middle, it can be time consuming and can add complexity (with more events and listeners) to properly make it work.

This occurs when the cluster layer has a min/maxZoom defined, the
map is loaded inside this zoom range BUT the defaultView=data, and
would immediately change the current zoom to a value outside this range.

In this case, the datalayer is added to the map, then the data is requested,
then the map view is recomputed with the full data bounds.

There may be a better fix on our side, but given there is async in the middle,
it can be time consuming and can add complexity (with more events and listeners)
to properly make it work.
@yohanboniface yohanboniface merged commit dac15bc into master Nov 7, 2023
@yohanboniface yohanboniface deleted the cluster-race-condition branch November 7, 2023 16:39
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