Cached Tiled Feature Source
Cache-first decorator over a TiledFeatureSource. On fetchTile:
Read store for
(z, x, y). Hit → return cached flow (an empty flow means the tile is cached with zero features — the negative-cache sentinel); if the tile is older than the store's eviction CachePolicy.staleAfter, also kick a background refresh (stale-while-revalidate — see maybeRevalidate).Miss → fetch from inner, write-through, return.
Constructors
Properties
The backing store. Exposed for bulk-download flows that persist store-level metadata (e.g. the downloaded-region bounding sector).
When true, fetchTile never calls inner — cache hits served, cache misses return null. Mirrors CachedTileSource.isCacheOnly.
The wrapped upstream tiled-feature source. Exposed for rebind flows — attachCache extractors peel this off when the layer is already cache-attached.
Invoked (off the render thread) after a stale tile is re-downloaded and replaced, so the render layer can drop its in-memory copy and reload the fresh rows.
Functions
Bulk-download counterpart to fetchTile — used by "save a region for offline use" flows. Ignores isCacheOnly (bulk always allows network) and writes the FULL fetch through to store. The write-through happens when the returned flow is collected, so the caller must drain it. Returns null when there's nothing to fetch (no rows / no network source).
Cache-only fast-path read for (z, x, y). Default returns null — a plain network source has no cache to consult. Cache-backed sources override to read their store without going through the network-fetch concurrency budget. Empty flow is the negative-cache sentinel ("fetched, no features"); null is a true miss.