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
  • Management
  • Statistics
  • Metadata

Was this helpful?

Edit on GitHub
Export as PDF
  1. Usage
  2. Root & Stores

Stores

PreviousRootNextIntegrating With A Map

Last updated 4 months ago

Was this helpful?

Stores maintain references to all tiles which belong to it, and also contain customizable metadata and cached statistics.

They are referenced by name, the single argument of FMTCStore.

Ensure names of stores are consistent across every access. "Typed"/code-generated stores are not provided, to maintain flexibility.

Construction of an FMTCStore object does create the underlying store, as this is an asynchronous task. It must be created before it may be used.

// final store = FMTCStore('storeName');
await FMTCStore('storeName').manage.create(); // Creates the store

Management

FMTCStore().manage allows control over the store and its contents.

Statistics

FMTCStore().stats allows access to:

  • statistics

  • retrieval of a recent tile (as an image)

  • watching of changes to the store

Metadata

FMTCStore().metadata allows access and control over a simple persistent storage mechanism, designed for use with custom data/properties/fields tied to the store. For example, in some apps, it could store the BrowseStoreStrategy or URL template/source.

Data is interpreted in key-value pair form, where both the key and value are Strings. Internally, the default backend stores it as a flat JSON structure. The metadata is stored directly on the store: if the store is deleted, it is deleted, and an exported store retains its metadata. More advanced requirements will require use of a separate persistence mechanism.

Remember that metadata does not have any effect on internal logic: it is simply an auxiliary method of storing any data that might need to be kept alongside a store.

StoreManagement class - flutter_map_tile_caching library - Dart API
StoreStats class - flutter_map_tile_caching library - Dart API
StoreMetadata class - flutter_map_tile_caching library - Dart API
Logo
Logo
Logo