@@ -330,19 +330,22 @@ private DataSet readMvt(InputStream source, ProgressMonitor progressMonitor) thr
330330 }
331331 ds = new DataSet ();
332332 final var currentBounds = new Bounds (this .downloadArea );
333+ progressMonitor .beginTask (tr ("Downloading data" ), 2 * tiles .size ());
333334 for (TileXYZ tileXYZ : tiles ) {
334335 try {
335336 final var hilbert = PMTiles .convertToHilbert (tileXYZ .z (), tileXYZ .x (), tileXYZ .y ());
336337 final var data = this .info .getSourceType () == MapWithAIType .PMTILES
337338 ? new ByteArrayInputStream (PMTiles .readData (header , hilbert , cachedDirectories ))
338- : getInputStream (getRequestForTile (tileXYZ ), progressMonitor );
339+ : getInputStream (getRequestForTile (tileXYZ ), progressMonitor . createSubTaskMonitor ( 1 , true ) );
339340 final var dataSet = loadTile (tileSource , tileXYZ , data );
340- ds .mergeFrom (dataSet , progressMonitor );
341+ ds .mergeFrom (dataSet , progressMonitor . createSubTaskMonitor ( 1 , true ) );
341342 tileXYZ .expandBounds (currentBounds );
342343 } catch (OsmTransferException | IOException e ) {
344+ progressMonitor .finishTask ();
343345 throw new IllegalDataException (e );
344346 }
345347 }
348+ progressMonitor .finishTask ();
346349 ds .addDataSource (new DataSource (currentBounds , this .url ));
347350 return ds ;
348351 }
0 commit comments