googlemaps / googlemaps/android-maps-compose

Clustering: Ability to set a BitmapDescriptor cache for custom cluster items (2.11 Clustering composable)

Open
#272 6 comments 8 reactions 0 assignees View on GitHub
priority: p2 type: feature request
Dominant language
Kotlin
Stars
1.3k
Forks
181
Avg merge
2d 23h
Merged PRs (30d)
18

Description

### Feature request

Add the ability to cache Bitmapdescriptor's to make the initial drawing smooth as not every single marker needs to recreate views

This is for both `clusterContent` & `clusterItemContent`

### Solutions:

1. Ability to specify a custom renderer (extending DefaultClusterRenderer)

Opening up the cluster manager to specify our own renderer would allow an easy way to support this feature by giving the developer the ability to build it himself

2. Specify some cache keys in order to avoid recreating the bitmap descriptor for identical items (in renderViewToBitmapDescriptor)

3. ...

### More context

Currently, I have implemented Clustering using MapEffect and I was able to make my redrawing experience as smooth as possible by recreating only different markers

For example I have 3000+ points but in practice only +-20 different item markers

I apply the same caching for cluster groups by defining a few buckets.

The solution I currently have in mind also means I do not plan to use Compose to create markers & clusters, that's fine as my goal is to make the experience as smooth as possible.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.