Create A Region
Last updated
Last updated
© Luka Stillingfleet (JaffaKetchup)
Regions (BaseRegion
s) are geographical areas that do not yet have any of the necessary extra information to start a download (this is the responsibility ofDownloadableRegion
).
There are 5 types of BaseRegion
.
RectangleRegion
s are defined by a LatLngBounds
: two opposite LatLng
s.
This is usually all you get from most apps, so why not give your user a unique experience with some of our other region types...
CircleRegion
s are defined by a center LatLng
and radius in kilometers.
If you instead have two coordinates, one in the center, and one on the edge, you can use method, as below:
LineRegion
s are defined by a list of LatLng
s, and a radius in meters.
This could be used to download tiles along a planned travel route, for example hiking or long-distance driving. Import coordinates from a routing engine, or from a GPX/KML file for maximum integration!
This region may generate more tiles than strictly necessary to cover the specified region. This is due to an internal limitation with the region generation algorithm, which uses (rotated) rectangles to approximate the actual desired shape.
This type of region may consume more memory/RAM when generating tiles than other region types.
Polygons should not contain self-intersections. These may produce unexpected results.
MultiRegion
s are defined by a list of multiple BaseRegion
s (which may contain more nested MultiRegion
s).
When downloading, each sub-region specified is downloaded consecutively (to ensure that any start
& end
tile range defined is respected consistently.
toOutline
is not supported by MultiRegion
.
RecoveredRegion
s aren't technically the same type of region as the others, as it doesn't inherit from BaseRegion
.
It is a hybrid of a BaseRegion
(region
), with parts of the DownloadableRegion
used to start the download, and some additional information about the recovery, such as the original store name & original download start time.
It can be converted to a DownloadableRegion
given a TileLayer
using toDownloadable
.
CustomPolygonRegion
s are defined by a list of LatLng
s defining the outline of a .
Holes are not supported, however multiple CustomPolygonRegion
s may be downloaded at once using a .
For more info, see .