-
Notifications
You must be signed in to change notification settings - Fork 172
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
Hi,
I'm using Google Maps Compose + Clustering.
I have standard case, I have markers (icon) and whenever I click on it I would like to change this icon.
Environment details
- maps-compose and maps-compose-utils v4.3.3
- Android 10, 15
Steps to reproduce
- Add markers
- Update item
Code example
LaunchedEffect(selectedLocationId) {
clusterManager ?: return@LaunchedEffect
clusterManager.algorithm.items.firstOrNull { it.location.id == selectedLocationId }?.let { selectedItem ->
clusterManager.updateItem(selectedItem.copy(selected = true))
clusterManager.cluster()
}
}
val renderer = rememberClusterRenderer(clusterContent, clusterItemContent, clusterManager)
From my point of view, whenever i called updateItem clusterItemContent or clusterContent should be called whenever item is different then it was.
Whenever i change code to:
LaunchedEffect(selectedLocationId) {
clusterManager ?: return@LaunchedEffect
clusterManager.algorithm.items.firstOrNull { it.location.id == selectedLocationId }?.let { selectedItem ->
clusterManager.removeItem(selectedItem)
clusterManager.cluster()
delay(5000)
clusterManager.updateItem(selectedItem.copy(selected = true))
clusterManager.cluster()
}
}
It works and i have new icon, however it's not accepted.
I also wanted to extend ComposeUiClusterRenderer and override onClusterItemUpdated but from unknown reason class is internal and i can't do that.
What is the correct way to just update a marker?
feivur
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.