您好,我正在尝试在Kotlin中实现Google Maps
,但是在这些代码中,我的getMapAsync
没有被调用, map 显示得很好,但标记未显示
var mapFragment : SupportMapFragment?=null
mapFragment= fragmentManager.findFragmentById(R.id.map) as SupportMapFragment?
mapFragment?.getMapAsync {
val sydney = LatLng(22.30, 73.20)
mMap!!.addMarker(MarkerOptions().position(sydney).title("Marker in Sydney"))
mMap!!.moveCamera(CameraUpdateFactory.newLatLng(sydney))
Toast.makeText(activity,"dfgdg",Toast.LENGTH_LONG).show() }
最佳答案
-33.8479731,150.6517908
关于android - Kotlin 与 map (标记未显示),我们在Stack Overflow上找到一个类似的问题:https://stackoverflow.com/questions/45387700/