You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This commit introduces a hacky solution to switch place markers on the map to use the Marker composable instead of custom composables. The advantage of using Marker is that we can leverage the built-in info window functionality, removing the need to manually create and position a custom info window.
Previously, when a place marker was selected, we had to calculate the position of its info window manually. If the user moved the map, the info window stayed in the same position on the screen instead of sticking to the marker on the map. One way to fix this was to update the state in real time to keep the info window in sync, but that caused constant state updates and heavy recompositions, making the UI sluggish.
To avoid this, I decided to use the Marker composable (or MarkerInfoWindowComposable to be specific because that is the one you can customize the most). However, due to a current issue (googlemaps/android-maps-compose#409) in the Google Maps Compose library, Marker composables cannot be used directly inside the clusterItemContent (causes an invalid applier error). To work around this, we create a separate marker composable for the selected item at the same position with the same appearance. This gives the same effect as if the cluster items themselves were Marker composables.
Part of #12, #42
Calculating latitude for centering cluster item click correctly to display the info window does not work on high zoom levels
The text was updated successfully, but these errors were encountered: