Bulk Downloading
Walkthrough
1
Define a region
final region = RectangleRegion(
LatLngBounds(LatLng(0, 0), LatLng(1, 1)),
);final region = CircleRegion(
LatLng(0, 0), // Center coordinate
1, // Radius in kilometers
);final centerCoordinate = LatLng(0, 0); // Center coordinate
final region = CircleRegion(
centerCoordinate,
const Distance(roundResult: false).distance(
centerCoordinate,
LatLng(1, 1), // Edge coordinate
) / 1000; // Convert to kilometers
);final region = LineRegion(
[LatLng(0, 0), LatLng(1, 1), ...], // List of coordinates
1000, // Radius in meters
);2
Add information to make the region downloadable
final downloadableRegion = region.toDownloadable(
minZoom: 1,
maxZoom: 18,
options: TileLayer(
urlTemplate: '<your tile server>',
userAgentPackageName: 'com.example.app',
),
),4
Configure and start the download
final (:downloadProgress, :tileEvents) =
const FMTCStore('mapStore').download.startForeground(
...
);5
Examples
Last updated
Was this helpful?