I have the coordinates of my markers in a LatLng arraylist. I add all the markers to a marker arraylist.
for(int i=0; i<markers_location.length; i++){
coords_markers.add(new LatLng(lat_markers.get(i), lon_markers.get(i)));}
List<Marker> markers = new ArrayList<>();
for(int i=0; i<markers_location.length; i++){
Marker marker = mMap.addMarker(new MarkerOptions().position(coords_markers.get(i)));
markers.add(marker);
}
How can I then add these markers to the map? I tried this:
mMap.addMarker(markers.get(0));
But it doesn't work.