Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cluster Item Update removes marker (Disappears) #573

Open
binayshaw7777 opened this issue May 28, 2024 · 0 comments
Open

Cluster Item Update removes marker (Disappears) #573

binayshaw7777 opened this issue May 28, 2024 · 0 comments
Labels
triage me I really want to be triaged. type: bug Error or flaw in code with unintended results or allowing sub-optimal usage patterns.

Comments

@binayshaw7777
Copy link

Hey,
I'm using Google Maps Compose along with Custom Cluster to render items on map, also I've the below property set to false
override fun shouldRenderAsCluster(cluster: Cluster<T>) = false

On updating item from clustered/rendered items on the map, the desired updated marker disappears sometimes.

Environment details

  1. 'com.google.maps.android:maps-compose:4.4.2' and 'com.google.maps.android:maps-compose-utils:4.4.2'
  2. Android 12 (API 31) Physical Device for testing and Windows 10 Desktop

Steps to reproduce

  1. Add some markers as cluster items in the map
  2. Update marker(s) in the map (frequently)
  3. The marker disappears unexpectedly

Code example

// COMPOSE VIEW
val itemToUpdate = clusterManager?.algorithm?.items?.find { it.getStation().id == 129 }
itemToUpdate?.station?.let { item ->
    item.status = if (showFilterBottomSheet.value) "AVAILABLE" else "PLANNED"
}
itemToUpdate?.let {
    val isUpdatedSuccess = clusterManager?.updateItem(it)
}
clusterManager?.cluster()
// CustomClusterRender
override fun onClusterItemUpdated(item: T, marker: Marker) {
        super.onClusterItemUpdated(item, marker)
        Timber.d("onClusterItemUpdated: ${item.title}")
        marker.setIcon(
           // Some internal logic to set marker color, also used in "onBeforeClusterItemRendered"
           // FYI: setIcon internal logic doesn't have any issue.
        )
    }

Video Example:
NOTE: The marker disappears at 00:11 and I'm using the Filter Icon on the top right to trigger the update manually.

Cluster.Item.Update.Issue.mp4

Thanks!

@binayshaw7777 binayshaw7777 added triage me I really want to be triaged. type: bug Error or flaw in code with unintended results or allowing sub-optimal usage patterns. labels May 28, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
triage me I really want to be triaged. type: bug Error or flaw in code with unintended results or allowing sub-optimal usage patterns.
Projects
None yet
Development

No branches or pull requests

1 participant