Getting a map marker by its ID in Google Maps v2

后端 未结 5 1696
爱一瞬间的悲伤
爱一瞬间的悲伤 2020-12-25 14:06

basically when adding a marker to the map it returns the new marker and you can gets the marker id from it like so

Marker m = map.addMarker(new MarkerOptions         


        
5条回答
  •  情深已故
    2020-12-25 14:53

    I know, its very late. But now, we can directly add a unique TAG to a marker.

    Marker marker = mMap.addMarker(markerOptions);
    marker.setTag("");
    

    Google Developers link about map marker TAG

提交回复
热议问题