tillnagel / unfolding

A library to create interactive maps and geovisualizations in Processing and Java
http://unfoldingmaps.org
Other
477 stars 245 forks source link

List<ImageMarker> problem #105

Closed ruralkan closed 9 years ago

ruralkan commented 9 years ago

Hi

I tried to make make a List of ImageMarkers: List stations = new ArrayList(); so, when I use the method map.addMarkers(stations) , processing say me: the method not is applicable for arguments List

Is There some option to use map.addMarkars with List

tillnagel commented 9 years ago

In your e-mail you clarified that you are trying to use List<ImageMarker>. However, the map.addMarker() method expects List<Marker> as parameter. Thus, you have to use the following:

List<Marker> stations = new ArrayList<ImageMarker>();
// .. populate list
map.addMarkers(stations);
ruralkan commented 9 years ago

When I try to use, I have this

Cannot convert from ArrayList to List

but I use a for cicle:

for(int i = 0; i <estaciones.size(); i++) {

map.addMarkers(estaciones.get(i));

}

It is work!!! Thanks I upload the sketch when I finish :D

eduzal commented 9 years ago

you'll probably have to cast the ArrayList as a List.

tillnagel commented 9 years ago

@ruralkan Closing it. Let me know if you have further troubles.