From 17ea98290319d98bedc712cef01c5998776dd615 Mon Sep 17 00:00:00 2001 From: Bjorn Sandvik Date: Mon, 4 Oct 2021 15:24:04 +0200 Subject: [PATCH] fix: update donut clusters on source data (#403) --- package.json | 2 +- src/layers/DonutCluster.js | 7 +------ yarn.lock | 8 ++++---- 3 files changed, 6 insertions(+), 11 deletions(-) diff --git a/package.json b/package.json index 1475f733..ceb9c5c7 100644 --- a/package.json +++ b/package.json @@ -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" diff --git a/src/layers/DonutCluster.js b/src/layers/DonutCluster.js index e58063ab..bedd7bfe 100644 --- a/src/layers/DonutCluster.js +++ b/src/layers/DonutCluster.js @@ -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() } } diff --git a/yarn.lock b/yarn.lock index 54e91dbd..e0fc08a4 100644 --- a/yarn.lock +++ b/yarn.lock @@ -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"