Search code examples
androidandroid-jetpack-composeandroid-maps

How to replace default info window marker with custom info window marker in map compose?


I would like to customise my info window marker of map in compose. My new info window marker is different in shape. I couldn't find proper solution to replace default one with new one.


Solution

  • This support is already available on the latest version of android-maps-compose. From the documentation, you can do something similar to:

    MarkerInfoWindow(
        state = yourMarker,
        icon = yourMarkerIcon,
        title = yourMarkerTitle
    ) { marker ->
        // Implement the custom info window here
        Column {
            Text(marker.title ?: "Default Marker Title", color = Color.Red)
            Text(marker.snippet ?: "Default Marker Snippet", color = Color.Red)
        }
    }