I've just started coding in android and after a very long time I got my google map to work and have been able to put markers on it.
What I want to do next is create a array of latlng and use for loop to put a marker on the google maps. I cannot figure out how to do. Could someone please help me. I have done the following so far.
ArrayList<Markers> mMap = new ArrayList<Markers>();
public ArrayList arraylist[] = {new ArrayList(
new LatLng(30.243442, -1.432320)),
I would like to expand this later, hence I would like to use array list.
I understand how the for loop works, but I cannot work out how to implement it with this as I cannot get those locations from array to tag on my map.
for (i = 0; i < cars.length; i++) {
mMap.addMarker(new MarkerOptions()
.position(new LatLng(10, 10))
.title("Hello world"));
}
I am completely lost from this stage. Could someone please guide and help me out.
Thanks.