I have this function makeAirportManagers() which should return an ArrayList <MarkerManager> all required variables map, countryMarkers and airportMarkers are global (dirty processing style).
ArrayList makeAirportManagers(){
ArrayList managers = new ArrayList();
for (Marker country : countryMarkers){
MarkerManager currentMarkerManager = new MarkerManager();
for (Marker airport : airportMarkers){
Location airportLocation = airport.getLocation();
ScreenPosition airportScreenPos = map.getScreenPosition(airportLocation);
if(country.isInside(map, airportScreenPos.x, airportScreenPos.y)){
currentMarkerManager.addMarker(airport);
}
}
currentMarkerManager.disableDrawing();
managers.add(currentMarkerManager);
map.addMarkerManager(currentMarkerManager);
airportManagersBuild = true;
return managers;
}
}
The console prints: This method must return a result of Type ArrayList
And really I don't no why!
In another version of the code, I count the items of managersto make sure it`s not empty and it gets 178 items like expected.
I am using Processing 1.5.1 because of the Unfolding library I'm playing with.