Skip to content

Commit

Permalink
fix: update donut clusters on source data (#403)
Browse files Browse the repository at this point in the history
  • Loading branch information
turban authored Oct 4, 2021
1 parent b01ed40 commit 17ea982
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 11 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
"@turf/length": "^6.3.0",
"fetch-jsonp": "^1.1.3",
"lodash.throttle": "^4.1.1",
"maplibre-gl": "^1.15.0",
"maplibre-gl": "^1.15.2",
"polylabel": "^1.1.0",
"suggestions": "^1.7.1",
"uuid": "^8.3.2"
Expand Down
7 changes: 1 addition & 6 deletions src/layers/DonutCluster.js
Original file line number Diff line number Diff line change
Expand Up @@ -51,12 +51,7 @@ class DonutCluster extends Cluster {
}

onSourceData = evt => {
if (
evt.sourceId === this.getId() &&
evt.isSourceLoaded &&
this.getSourceFeatures().length
) {
this.getMapGL().off('sourcedata', this.onSourceData)
if (evt.sourceId === this.getId() && this.getSourceFeatures().length) {
this.updateClusters()
}
}
Expand Down
8 changes: 4 additions & 4 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -4685,10 +4685,10 @@ map-visit@^1.0.0:
dependencies:
object-visit "^1.0.0"

maplibre-gl@^1.15.0:
version "1.15.0"
resolved "https://registry.yarnpkg.com/maplibre-gl/-/maplibre-gl-1.15.0.tgz#6efa96b5fdda218390cb9db3eb1e901dc6ca9f51"
integrity sha512-C3Mq7HDTndvAs8w+Ai1QzvVdN7xG2+2iHjtp3Pkmk7tJeSMcqZzQYHKyOCBkpTs7g2P/aFqMU8Tg853RIZxIZg==
maplibre-gl@^1.15.2:
version "1.15.2"
resolved "https://registry.yarnpkg.com/maplibre-gl/-/maplibre-gl-1.15.2.tgz#7fb47868b62455af916c090903f2154394450f9c"
integrity sha512-uPeV530apb4JfX3cRFfE+awFnbcJTOnCv2QvY4mw4huiInbybElWYkNzTs324YLSADq0f4bidRoYcR81ho3aLA==
dependencies:
"@mapbox/geojson-rewind" "^0.5.0"
"@mapbox/geojson-types" "^1.0.2"
Expand Down

0 comments on commit 17ea982

Please sign in to comment.