Skip to content Skip to sidebar Skip to footer

List List Always Return List Size() =1 Here Map

Here I am adding marker on map: hereMap.addMapObject(new MapMarker(new GeoCoordinate(lat,lng), myImage) .setTitle('marker'+geoCounter) .setDescription(' \nLatitude :'

Solution 1:

Seems

publicabstractbooleanonMapObjectsSelected(java.util.List <ViewObject> objects)

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 example ArrayList<MapMarker>) of your choice after you call addMarker(), like in this answer. For example:

ArrayList<MapMarker> mMarkersList = new ArrayList();
...
MapMarker marker = new MapMarker(new GeoCoordinate(lat,lng), myImage)
            .setTitle("marker"+geoCounter)
            .setDescription(" \nLatitude :" +lati+  "\nLongitude : "+ lng)
mMarkersList.add(marker);
hereMap.addMapObject(marker);

then get it from mMarkersList:

MapMarker marker = mMarkersList.get(<number_of_marker>)

Post a Comment for "List List Always Return List Size() =1 Here Map"