Skip to content

feat: add getClusterOptions getter to GeoJSONSource#7948

Merged
HarelM merged 7 commits into
maplibre:mainfrom
lazerg:feat/7788-get-cluster-options
Jul 23, 2026
Merged

feat: add getClusterOptions getter to GeoJSONSource#7948
HarelM merged 7 commits into
maplibre:mainfrom
lazerg:feat/7788-get-cluster-options

Conversation

@lazerg

@lazerg lazerg commented Jul 15, 2026

Copy link
Copy Markdown
Contributor

Fixes #7788

Adds a getClusterOptions getter to GeoJSONSource that returns the source's current cluster configuration (cluster, clusterMaxZoom and clusterRadius), mirroring the options accepted by setClusterOptions. This lets callers check whether a source is clustered and read its clusterMaxZoom through the public API instead of reaching into worker internals.

Launch Checklist

  • Confirm your changes do not include backports from Mapbox projects (unless with compliant license) - if you are not sure about this, please ask!
  • Briefly describe the changes in this PR.
  • Link to related issues.
  • Include before/after visuals or gifs if this PR includes visual changes.
  • Write tests for all new functionality.
  • Document any changes to public APIs.
  • Post benchmark scores.
  • Add an entry to CHANGELOG.md under the ## main section.
  • Confirm you have read our AI policy here.

@lazerg
lazerg force-pushed the feat/7788-get-cluster-options branch from cf3f260 to dbd44fb Compare July 15, 2026 10:58
@codecov

codecov Bot commented Jul 15, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 93.36%. Comparing base (02e7b0f) to head (9003802).
⚠️ Report is 1 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #7948      +/-   ##
==========================================
- Coverage   93.38%   93.36%   -0.02%     
==========================================
  Files         288      288              
  Lines       24441    24446       +5     
  Branches     6461     6461              
==========================================
+ Hits        22824    22825       +1     
- Misses       1617     1621       +4     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@CommanderStorm CommanderStorm left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

makes sense to me and LGTM

Comment thread src/source/geojson_source.test.ts Outdated
@HarelM

HarelM commented Jul 23, 2026

Copy link
Copy Markdown
Collaborator

Added a small comment on the test, once fixed this can be merged.

@HarelM
HarelM enabled auto-merge (squash) July 23, 2026 11:14
@HarelM
HarelM merged commit 7dfd543 into maplibre:main Jul 23, 2026
39 of 41 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Allow getting cluster options for a source

3 participants