Kotlin with Map ( Marker Not showing)

Viewed 1296

Hello I'm trying to implements Google Maps in kotlin, but in these code my getMapAsyncis not getting called, the maps shows perfectly but the marker doesn't show up

    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() }
1 Answers
Related