From 583e09fdc2612c35eb13ce84d7532b3b54595a0a Mon Sep 17 00:00:00 2001 From: Vladimir Agafonkin Date: Tue, 19 Jan 2021 13:13:47 +0200 Subject: [PATCH 1/2] upgrade Supercluster to v7.1.2, uncap clusterMaxRadius --- package.json | 2 +- src/source/geojson_source.js | 4 +--- yarn.lock | 8 ++++---- 3 files changed, 6 insertions(+), 8 deletions(-) diff --git a/package.json b/package.json index 96147aeebf9..bdef16f7cdd 100644 --- a/package.json +++ b/package.json @@ -33,7 +33,7 @@ "potpack": "^1.0.1", "quickselect": "^2.0.0", "rw": "^1.3.3", - "supercluster": "^7.1.0", + "supercluster": "^7.1.2", "tinyqueue": "^2.0.3", "vt-pbf": "^3.1.1" }, diff --git a/src/source/geojson_source.js b/src/source/geojson_source.js index 889517eb30e..d903f7bc65b 100644 --- a/src/source/geojson_source.js +++ b/src/source/geojson_source.js @@ -135,9 +135,7 @@ class GeoJSONSource extends Evented implements Source { generateId: options.generateId || false }, superclusterOptions: { - maxZoom: options.clusterMaxZoom !== undefined ? - Math.min(options.clusterMaxZoom, this.maxzoom - 1) : - (this.maxzoom - 1), + maxZoom: options.clusterMaxZoom !== undefined ? options.clusterMaxZoom : this.maxzoom - 1, minPoints: Math.max(2, options.clusterMinPoints || 2), extent: EXTENT, radius: (options.clusterRadius || 50) * scale, diff --git a/yarn.lock b/yarn.lock index 0e94b66fa41..bff83fe9594 100644 --- a/yarn.lock +++ b/yarn.lock @@ -10295,10 +10295,10 @@ sugarss@^2.0.0: dependencies: postcss "^7.0.2" -supercluster@^7.1.0: - version "7.1.0" - resolved "https://registry.yarnpkg.com/supercluster/-/supercluster-7.1.0.tgz#f0a457426ec0ab95d69c5f03b51e049774b94479" - integrity sha512-LDasImUAFMhTqhK+cUXfy9C2KTUqJ3gucLjmNLNFmKWOnDUBxLFLH9oKuXOTCLveecmxh8fbk8kgh6Q0gsfe2w== +supercluster@^7.1.2: + version "7.1.2" + resolved "https://registry.yarnpkg.com/supercluster/-/supercluster-7.1.2.tgz#cf02a60283a0118212024f3bf02e4e63bb148e2c" + integrity sha512-bGA0pk3DYMjLTY1h+rbh0imi/I8k/Lg0rzdBGfyQs0Xkiix7jK2GUmH1qSD8+jq6U0Vu382QHr3+rbbiHqdKJA== dependencies: kdbush "^3.0.0" From 7411e913d21bdaec72383350567fee1ff26c4193 Mon Sep 17 00:00:00 2001 From: Vladimir Agafonkin Date: Fri, 22 Jan 2021 17:53:31 +0200 Subject: [PATCH 2/2] add a render test for clusterMaxZoom --- .../geojson/clustered-max-zoom/expected.png | Bin 0 -> 492 bytes .../geojson/clustered-max-zoom/style.json | 39 ++++++++++++++++++ 2 files changed, 39 insertions(+) create mode 100644 test/integration/render-tests/geojson/clustered-max-zoom/expected.png create mode 100644 test/integration/render-tests/geojson/clustered-max-zoom/style.json diff --git a/test/integration/render-tests/geojson/clustered-max-zoom/expected.png b/test/integration/render-tests/geojson/clustered-max-zoom/expected.png new file mode 100644 index 0000000000000000000000000000000000000000..8154fd54d592e0235d35a8d41da516d3cb82e54f GIT binary patch literal 492 zcmV>(|H}&G->|X5PC`&1T;2bYxFNeows=L!%Ag0%-UL#JU&;Yyh*sOkjZ0B{2^C1C}YLl*d2- z