Skip to content

Commit

Permalink
fix: wait until source is loaded for all tiles (#314)
Browse files Browse the repository at this point in the history
  • Loading branch information
turban authored Apr 14, 2021
1 parent f0376b0 commit 1c410a7
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/layers/DonutCluster.js
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,11 @@ class DonutCluster extends Cluster {
}

onSourceData = evt => {
if (evt.sourceId === this.getId() && this.getSourceFeatures().length) {
if (
evt.sourceId === this.getId() &&
evt.isSourceLoaded &&
this.getSourceFeatures().length
) {
this.getMapGL().off('sourcedata', this.onSourceData)
this.updateClusters()
}
Expand Down

0 comments on commit 1c410a7

Please sign in to comment.