* @return The Future representing the asynchronous download task
*/
public Future<?> download(boolean newLayer, List<Rectangle2D> rects, boolean osmData, boolean gpxData, ProgressMonitor progressMonitor) {
this.progressMonitor = progressMonitor;
if (newLayer) {
Layer l = new OsmDataLayer(new DataSet(), OsmDataLayer.createNewName(), null);
Main.main.addLayer(l);
Main.map.mapView.setActiveLayer(l);
}
int n = (osmData && gpxData ? 2 : 1)*rects.size();