toDownloadable method

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

Convert this region into a downloadable region

Implementation

DownloadableRegion toDownloadable(
  TileLayer 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._(
    points: type == RegionType.line
        ? (region as LineRegion).toOutlines()
        : region.toOutline(),
    minZoom: minZoom,
    maxZoom: maxZoom,
    options: options,
    type: type,
    originalRegion: region,
    parallelThreads: parallelThreads,
    preventRedownload: preventRedownload,
    seaTileRemoval: seaTileRemoval,
    start: start,
    end: end,
    crs: crs,
    errorHandler: errorHandler,
  );
}