I have a maps which has marker. I want to add a KML layer on it to show a KML from google thanks to a KMZ file. But, when I add the new layer, the custom marker is no longer appearing.
I'm using this code:
(childFragmentManager.findFragmentById(R.id.googleMap) as SupportMapFragment).getMapAsync { map ->
map.clear()
map.setInfoWindowAdapter(GoogleMapWindow())
// now I add all of my markers
val content = resources.openRawResource(R.raw.carte)
val layer = KmlLayer(map, content, context) // this line breaks the marker
layer.addLayerToMap()
}
The GoogleMapWindow is like this:
class GoogleMapWindow() : InfoWindowAdapter {
override fun getInfoWindow(marker: Marker): View {
return TextView("My custom marker text") // example of code
}
}
Before adding the new layer, the generated layout were appearing. Now, it's not the case.
I tried to set the adapter after and before adding the new layer but this didn't changed anything.
How can I add the new layer without break my custom info window?