Skip to content

feat(clustering): add SuperCluster algorithm demo and configurable popup menu controls - #1017

Draft
dkhawk wants to merge 1 commit into
mainfrom
test/supercluster-compose
Draft

dkhawk wants to merge 1 commit into
mainfrom
test/supercluster-compose

Conversation

@dkhawk

@dkhawk dkhawk commented Sep 30, 2026

Copy link
Copy Markdown
Collaborator

Summary

This draft PR integrates the new high-performance SuperClusterAlgorithm into the Maps Compose sample demo app (maps-app), replacing horizontal chip bars with an elegant floating Material 3 control bar featuring popup menus and configurable dataset sizes up to 100,000 markers.

Note: This PR is currently in Draft state for integration testing and benchmarking against the upcoming android-maps-utils-clustering release containing SuperClusterAlgorithm (PR googlemaps/android-maps-utils#1799).

Key Additions & Improvements

  1. SuperCluster Integration:

    • Added SuperClusterNative mode: leverages SuperClusterAlgorithm with DefaultClusterRenderer, compact SI unit notation (k/m), and cached bitmap badges for 60fps pan/zoom across tens of thousands of markers.
    • Added SuperClusterCompose mode: uses Compose UI cluster badges while using native marker rendering for unclustered pins (clusterItemContent = null) to avoid allocating thousands of ComposeView hierarchies on the UI thread.
  2. 50K & 100K Dataset Buckets:

    • Added 50,000 (50K) and 100,000 (100K) marker buckets alongside 10, 500, 2,500, 10,000, and 25,000.
    • Tuned regional coordinate dispersion (spread = 4.0) for realistic multi-level hierarchical clustering across Singapore and neighboring regions.
  3. Floating Control Bar with Popup Menus (ClusteringControlBar):

    • Replaced clunky horizontal chip rows with a compact floating Material 3 Card pinned at TopCenter.
    • Algorithm Popup Menu: FilledTonalButton with ArrowDropDown to pick between all available clustering modes with selection checkmarks.
    • Dataset Size Popup Menu: FilledTonalButton with ArrowDropDown to pick marker counts from 10 to 100K.
    • Directly Visible Animation Toggle: A FilterChip labeled Anim ON / Anim OFF directly visible on the bar to evaluate the performance difference between 300ms frame interpolation and instant zero-overhead clustering.
  4. Heap Headroom:

    • Enabled android:largeHeap="true" in maps-app/src/main/AndroidManifest.xml for smooth mega-scale testing.

…pup menu controls

- Integrate SuperClusterAlgorithm from android-maps-utils-clustering:5.2.0 into Maps Compose demo app.
- Add SuperClusterNative (high-performance native markers with compact badge formatting) and SuperClusterCompose modes.
- Replace scrolling chip bars with a floating Material 3 ClusteringControlBar featuring popup menus for algorithm and dataset selection.
- Add 50,000 (50K) and 100,000 (100K) dataset buckets with realistic regional point spread.
- Add directly visible Anim: ON / Anim: OFF toggle to compare 300ms marker transition animations against instant 60fps clustering.
- Enable largeHeap in maps-app/src/main/AndroidManifest.xml for mega-scale marker headroom.
@dkhawk
dkhawk force-pushed the test/supercluster-compose branch from cec7d48 to f89bead Compare October 1, 2026 21:07

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant