-
Notifications
You must be signed in to change notification settings - Fork 1.5k
Open
Labels
triage meI really want to be triaged.I really want to be triaged.type: bugError or flaw in code with unintended results or allowing sub-optimal usage patterns.Error or flaw in code with unintended results or allowing sub-optimal usage patterns.
Description
Summary
Weird cluster behaviour when clusters change with an animation on zooming. The cluster icon refreshes, resulting in a flickering shadow, even though the cluster position has not changed.
The shadow flicker is caused by a new cluster appearing on top of the existing one during the animation.
Expected behavior
I would expect the cluster to not animate if there is no position change. This would prevent a shadow flickering.
Observed behavior
When clusters are (re-)clustered, this also affects a cluster that has remained in the same position, causing the shadow to blink.
Screen_recording_20240312_133131ss.webm
Environment details
kotlin = "1.9.0"
mapUtils = "5.0.0"
playServicesMaps = "18.2.0"
Code example
Custom renderer with no additional modifications.
class CustomClusterRenderer(
private val context: Context,
map: GoogleMap,
clusterManager: ClusterManager<MyItem>
) : DefaultClusterRenderer<MyItem>(context, map, clusterManager) {
private val markerSize = context.resources.getDimensionPixelSize(R.dimen.marker_size)
override fun onBeforeClusterItemRendered(item: MyItem, markerOptions: MarkerOptions) {
markerOptions
.icon(getIcon())
}
override fun onClusterItemRendered(clusterItem: MyItem, marker: Marker) {
marker.run {
setIcon(getIcon())
}
}
override fun onBeforeClusterRendered(cluster: Cluster<MyItem>, markerOptions: MarkerOptions) {
markerOptions.icon(getIcon())
}
override fun onClusterUpdated(cluster: Cluster<MyItem>, marker: Marker) {
marker.setIcon(getIcon())
}
override fun shouldRenderAsCluster(cluster: Cluster<MyItem?>): Boolean {
return cluster.size > 1
}
private fun getIcon(): BitmapDescriptor {
val bitmap = BitmapFactory.decodeResource(context.resources, R.drawable.marker1)
.scale(markerSize, markerSize, false)
return BitmapDescriptorFactory.fromBitmap(bitmap);
}
}
muscardinus and h-forhad
Metadata
Metadata
Assignees
Labels
triage meI really want to be triaged.I really want to be triaged.type: bugError or flaw in code with unintended results or allowing sub-optimal usage patterns.Error or flaw in code with unintended results or allowing sub-optimal usage patterns.