I’m developing GIS-app in Kotlin using Google Maps API. There are some markers loaded from KML-files. Clicking on these markers – displays attributes information in a bottom sheet fragment.
kmlLayer.setOnFeatureClickListener { feature ->
if (feature is KmlPlacemark) {
displayAttributes(kmlLayer, feature)
}
}
Also I manually add other markers to indicate locations suitable for AR.
ArCoreApk.getInstance().checkAvailabilityAsync(this) { availability ->
if (availability.isSupported) {
val gtp = map.addMarker(
MarkerOptions()
.position(LatLng(55.7522, 37.6156))
.title("AR")
.snippet("Test 3D model")
.icon(BitmapDescriptorFactory.fromResource(R.drawable.cube))
)
map.setOnMarkerClickListener { marker: Marker ->
if (marker == gtp) {
startActivity(Intent(this, ViewModelActivity::class.java))
true
} else {
false
}
}
}
}
However, when I add markers for open AR activity, clicking on the KML markers no longer displays attribute information. How can I avoid this problem?
New contributor
sonik is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.