MultiRegion class

A region formed from multiple other BaseRegions

When downloading, each sub-region specified in regions is downloaded consecutively. The advantage of MultiRegion is that:

  • it avoids repeating the expensive setup and teardown of a bulk download between each sub-region
  • the progress of the download is reported as a whole, so no additional work is required to keep track of which download is currently being performed and keep track of custom progress statistics

Overlaps and intersections are not (yet) compiled into single CustomPolygonRegions. Therefore, where regions are known to overlap:

  • (particularly where regions are RectangleRegions & CustomPolygonRegions) Use 'package:polybool' (a 3rd party package in no way associated with FMTC) to take the union all polygons: this will remove self-intersections, combine overlapping polygons into single polygons, etc - this is best for efficiency.

  • (particularly where multiple different other region types are used) Enable skipExistingTiles in StoreDownload.startForeground.

MultiRegions may be nested.

toOutline is not supported and will always throw.

Inheritance

Constructors

MultiRegion(List<BaseRegion> regions)
Create a region formed from multiple other BaseRegions
const

Properties

hashCode int
The hash code for this object.
no setteroverride
regions List<BaseRegion>
List of sub-regions
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

maybeWhen<T>({T rectangle(RectangleRegion rectangle)?, T circle(CircleRegion circle)?, T line(LineRegion line)?, T customPolygon(CustomPolygonRegion customPolygon)?, T multi(MultiRegion multi)?}) → T?
Output a value of type T the type of this region
inherited
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toDownloadable({required int minZoom, required int maxZoom, required TileLayer options, int start = 1, int? end, Crs crs = const Epsg3857()}) DownloadableRegion<MultiRegion>
Generate the DownloadableRegion ready for bulk downloading
override
toOutline() → Never
MultiRegions do not support toOutline, as it would not be useful, and it is out of scope to implement a convex-hull for no real purpose
override
toString() String
A string representation of this object.
inherited
when<T>({required T rectangle(RectangleRegion rectangle), required T circle(CircleRegion circle), required T line(LineRegion line), required T customPolygon(CustomPolygonRegion customPolygon), required T multi(MultiRegion multi)}) → T
Output a value of type T the type of this region
inherited

Operators

operator ==(Object other) bool
The equality operator.
override