FMTC Docs
Project Links💝 Support Me
v10
v10
  • flutter_map_tile_caching
  • ❔Is FMTC Right For Me?
  • 💝Supporters
  • 📃(Proprietary) Licensing
  • Full API Reference
  • 🚀Get Started
    • Quickstart
    • Installation
    • Example Application
    • v9 -> v10 Migration
  • Usage
    • Initialisation
    • Root & Stores
      • Root
      • Stores
    • Integrating With A Map
    • Bulk Downloading
      • Recovery
      • Testing Tile Server
    • Import/Export
      • Exporting
      • Importing
  • flutter_map Docs
Powered by GitBook

© Luka Stillingfleet (JaffaKetchup)

On this page

Was this helpful?

Edit on GitHub
Export as PDF
  1. Usage
  2. Bulk Downloading

Recovery

PreviousBulk DownloadingNextTesting Tile Server

Last updated 5 months ago

Was this helpful?

RootRecovery, accessed via FMTCRoot.recovery, allows access to the bulk download recovery system, which is designed to allow rescue (salvation and restarting) of failed downloads when they crashed due to an unexpected event.

// List all recoverable regions, and whether each one has failed
await FMTCRoot.recovery.recoverableRegions; 
// List all failed downloads
await FMTCRoot.recovery.recoverableRegions.failedOnly; 
// Retrieve a specific recoverable region by ID
await FMTCRoot.recovery.getRecoverableRegion();
// Safely remove the specified recoverable region
await FMTCRoot.recovery.cancel(); 

RecoveredRegion

RecoveredRegions are wrappers containing recovery & some downloadable region information, around a DownloadableRegion.

Once a RecoveredRegion has been retreived, it contains the original BaseRegion in the region property.

To create a DownloadableRegion using the other available information with a provided TileLayer, use toDownloadable.

A RecoveredRegion (and a DownloadableRegion generated from it) will point to only any remaining, un-downloaded tiles from the failed download.

The start tile will be adjusted from the original to reflect the progress of the download before it failed, meaning that tiles already successfully cached (excluding buffered) will not be downloaded again, saving time and network transfers. The end tile will be either the original, or the maximum number of tiles normally in the region (which will have no resulting difference than null, but allows for a quick estimate of the number of remaining tiles to be made without needing to recheck the entire region).

RootRecovery class - flutter_map_tile_caching library - Dart API
Logo