Google Maps V2 - Android - Get a list of Markers

后端 未结 2 1152
别跟我提以往
别跟我提以往 2020-12-05 23:30

I\'m trying to get a list Markers(using GMaps V2 for Android) similar to the getOverlays() method I used in GMaps V1.1 for Android here:

private MapView mapV         


        
2条回答
  •  心在旅途
    2020-12-06 00:01

    Alternative to the correct answer from CommonsWare would be using Android Maps Extensions, which adds getMarkers() function to GoogleMap.

    Btw. mapView.getOverlays().add(overlay) code from Maps V1 is a very bad design choice. You should not give out List for modification. So this will not work with Extensions library.

提交回复
热议问题