toDownloadable method

DownloadableRegion toDownloadable(
  1. TileLayerOptions options, {
  2. Crs crs = const Epsg3857(),
  3. dynamic errorHandler(
    1. Object?
    )?,
})

Convert this region into a downloadable region

Implementation

DownloadableRegion toDownloadable(
  TileLayerOptions options, {
  Crs crs = const Epsg3857(),
  Function(Object?)? errorHandler,
}) {
  final BaseRegion region = type == RegionType.rectangle
      ? RectangleRegion(bounds!)
      : type == RegionType.circle
          ? CircleRegion(center!, radius!)
          : LineRegion(line!, radius!);

  return DownloadableRegion.internal(
    points: region.toList(),
    minZoom: minZoom,
    maxZoom: maxZoom,
    options: options,
    type: type,
    originalRegion: region,
    parallelThreads: parallelThreads,
    preventRedownload: preventRedownload,
    seaTileRemoval: seaTileRemoval,
    start: start,
    end: end,
    crs: crs,
    errorHandler: errorHandler,
  );
}