Here I am adding marker on map:
hereMap.addMapObject(new MapMarker(new GeoCoordinate(lat,lng), myImage)
.setTitle("marker"+geoCounter)
.setDescription(" \nLatitude :" +lati+ "\nLongitude : "+ lng));
adding lat lng with array list of lat lng but when I add the marker with the help of:
@Override
public void onLocationChanged(Location location) {...}
List<ViewObject>
list gives me the exact size of the added marker.
In this case, I get lat long with:
location.getLatitude()
location.getLongitude()
Here are the map markers on map:
Here I get size like this:
Seems
A callback indicating that at least one ViewObject has been selected as a result of a user tapping on the map. So
objects
has only selected markers. For get access to all markers on map You should save the resulting Marker object in a collection (for exampleArrayList<MapMarker>
) of your choice after you calladdMarker()
, like in this answer. For example:then get it from
mMarkersList
: