How to add marker on google maps android?

后端 未结 5 2052
一向
一向 2021-01-01 13:20

I am a beginner in Android programming. I already looked at similar questions and answers but I still can\'t figure out why this doesn\'t work. When I try this on the emulat

5条回答
  •  独厮守ぢ
    2021-01-01 13:30

    try in this way. Pass your latitude and longitude values

    // create marker
    MarkerOptions marker = new MarkerOptions().position(new LatLng(latitude, longitude)).title("Hello Maps");
    
    // adding marker
    googleMap.addMarker(marker);
    

提交回复
热议问题