bulkDownloader function
Stream<TileProgress>
bulkDownloader({
- required List<
Coords< tiles,num> > - required FMTCTileProvider provider,
- required TileLayerOptions options,
- required Client client,
- required dynamic errorHandler()?,
- required int parallelThreads,
- required bool preventRedownload,
- required Uint8List? seaTileBytes,
- required Queue queue,
- required StreamController<
TileProgress> streamController, - required int downloadID,
- required InternalProgressTimingManagement progressManagement,
Implementation
Stream<TileProgress> bulkDownloader({
required List<Coords<num>> tiles,
required FMTCTileProvider provider,
required TileLayerOptions options,
required http.Client client,
required Function(Object?)? errorHandler,
required int parallelThreads,
required bool preventRedownload,
required Uint8List? seaTileBytes,
required Queue queue,
required StreamController<TileProgress> streamController,
required int downloadID,
required InternalProgressTimingManagement progressManagement,
}) {
for (final Coords<num> coord in tiles) {
queue
.add(
() => _getAndSaveTile(
provider: provider,
coord: coord,
options: options,
client: client,
errorHandler: errorHandler,
preventRedownload: preventRedownload,
seaTileBytes: seaTileBytes,
downloadID: downloadID,
progressManagement: progressManagement,
),
)
.then(
(e) {
if (!streamController.isClosed) streamController.add(e);
},
);
}
return streamController.stream;
}