admin管理员组文章数量:1220994
I'm trying to implement Google Maps in Jetpack compose:
GoogleMap(
modifier = Modifier.fillMaxSize(),
cameraPositionState = cameraPositionState
) {
val bitmapDescriptor: BitmapDescriptor by remember { mutableStateOf(BitmapDescriptorFactory.fromResource(R.drawable.place)) }
for (busStop in uiState.data) {
Marker(
state = rememberMarkerState(position = LatLng(busStop.lat, busStop.lon)),
title = busStop.name,
snippet = "" + busStop.lat + "," + busStop.lon,
icon = bitmapDescriptor
)
}
MarkerInfoWindowContent(
// what should I do here?
) { marker ->
// what should I do here?
Text(marker.title ?: "Default Marker Title", color = Color.Red)
}
}
As you can see, I'm adding a list of Markers using that for. Now I need to customize my InfoWindow, I want to specify a custom content for it, but I don't find how to do it. In the official documentation they just say this:
You can customize a marker's info window contents by using the MarkerInfoWindowContent element
MarkerInfoWindowContent(
//...
) { marker ->
Text(marker.title ?: "Default Marker Title", color = Color.Red)
}
As you can see documentation is very poor, so I don't have any idea of how to implement my custom infowindow and how to pass it the current marker value.
本文标签: androidHow to specify MarkerInfoWindowContent for my Markers in Compose MapsStack Overflow
版权声明:本文标题:android - How to specify MarkerInfoWindowContent for my Markers in Compose Maps? - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1739286535a2156491.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论