Content Manager
Persistent cache for vector-data and tile-pyramid layers. One ContentManager instance manages many independent content entries (each keyed by contentKey), each backed by one GeoPackage table or table set.
The manager is a substitute for the originating network source — it stores what the server returned (bytes or feature rows) and nothing more. Styling, layer-state, and sprite atlases live on the caller's side and never enter the cache.
Typical caller flow:
openXxxStore(contentKey, …)to obtain a store bound to a GPKG table.Build a earth.worldwind.layer.cache.CachedTileSource / earth.worldwind.layer.cache.CachedBulkFeatureSource / earth.worldwind.layer.cache.CachedTiledFeatureSource over the store + the network source.
Construct a layer over that cached source with the desired styling.
For elevation coverages, prefer createElevationSourceFactory over openCoverageStore directly — the factory owns the source-format → storage-format transcoding (Float32 ↔ Int16) so callers don't have to know how their network output format relates to the disk storage layout. The returned factory plugs directly into earth.worldwind.globe.elevation.coverage.TiledElevationCoverage.
To recreate the layer on a subsequent launch without contacting the server, store web-service metadata via registerWebService and read it back via findEntry / listEntries — capabilities XML/JSON in WebServiceInfo.metadata survives across launches.
Inheritors
Functions
Register a tiled image layer (WMS / WMTS / WebMercator).
Register a vector layer. Dispatches by concrete subtype to record the right service-identity row:
Register a tiled elevation coverage.
Truncate one content entry's tile / feature payload while keeping its registration intact — the WebServiceInfo row, the persisted level-set / tile-matrix-set, the display name, the isFloat choice, and any other per-content metadata stay so the caller can re-download tiles without re-configuring the layer.
Wrap one contentKey inside this ContentManager as a ContentEntry. Mirrors findEntry(key) for read-only inspection plus clearEntry / deleteEntry for lifecycle, behind one uniform surface.
Total on-disk size of the cache database.
Build an ElevationSourceFactory backed by this content manager's elevation cache. The factory owns the source-format → storage-format transcoding for every tile — callers just supply the network source (or null for offline replay) and the desired storage layout via isFloat.
Delete one content entry — drops the table(s), the web-service row, and the contents-table row. Use clearEntry instead when the caller wants to keep the layer registered for a re-download.
Look up a single content entry by contentKey, or null if absent. Lightweight — same shape as one element of listEntries.
Most-recent modification across all content. null if the cache is empty.
Enumerate every cached content entry. Lightweight — does not construct layers or read row data, only metadata.
Bulk-open every cached entry whose CacheEntry.dataType matches category. Return type follows the category's phantom witness:
Open (or create) a URI-keyed BlobStore — a flat key/value store for arbitrary HTTP payloads. Distinct from openImageTileStore / openFeatureStore in that entries are keyed by string URI rather than by (z, x, y) or a feature id, which makes it the right shape for caches whose entries are independent URLs.
Open contentKey as an elevation coverage narrowed to T. Returns null when the key is absent, registered as a layer (use openLayer), or the materialized type doesn't match T. Bound is the broad ElevationCoverage interface for symmetry with openLayer's Layer bound; today only TiledElevationCoverage subtypes are reachable from cache, so non-tiled-typed callers always get null.
Open (or create) a FeatureStore for vector-feature data — backed by data_type='features' in the GPKG schema. Used by WFS, Shapefile (bulk rows) and OsmBuildings (tile-addressed rows) in the same store shape.
Open (or create) a TileStore for image-tile data — backed by data_type='tiles' in the GPKG schema. Used by WMS/WMTS/WebMercator and any other raster layer that fetches PNG/JPEG/WebP bytes. Re-opening the same contentKey returns a store compatible with the previously persisted LevelSet (validates compatibility).
Open contentKey as a layer narrowed to T. Returns null when the key is absent, unregistered, backed by an elevation coverage (use openElevationCoverage), or the materialized type doesn't match T.
Reopen an Ogc3dTilesLayer from a ContentManager entry registered by an earlier openBlobStore(...) + registerWebService(...) pair. Reads the persisted earth.worldwind.layer.cache.WebServiceInfo (root URI in .address, auth-provider class name in .layerName, credentials JSON in .metadata) and rebuilds the layer end-to-end so the caller only has to do engine.layers.addLayer(layer).
Open (or create) a TileStore for vector-tile data — backed by data_type='vector-tiles' (im_vector_tiles_mapbox extension). Used by MVT layers that store raw protobuf bytes per tile.
Persist web-service metadata for contentKey in the GPKG gpkg_web_service extension table. Capabilities XML/JSON in WebServiceInfo.metadata survives across launches so the layer can be reconstructed without an online capabilities request.
Overwrite the user-visible display name for contentKey. No-op when the content key doesn't exist or the manager is read-only.
Approximate on-disk byte size of one content entry. Sums tile blobs / feature rows in the store(s) backing contentKey; 0 if no such content is registered.
Open a cached layer/coverage for a CacheEntry that has no registered web service — i.e. the content was imported directly into the cache (e.g. a standalone .gpkg file with no gpkg_web_service row). Returns null when the backend can't construct a layer in this mode.
Recover the pyramid LevelSet for an image / vector-tile cache, or null when the backend can't reconstruct one (e.g. JS / iOS where the schema doesn't persist the level-set descriptors). Used by the cross-platform reopen dispatcher to rebuild a layer's level-set after restart; callers fall back to a sensible default (slippy-map 0..21) when this returns null.
Recover the TileMatrixSet for a coverage cache, or null when the backend can't reconstruct one. Mirrors tryRecoverLevelSet for elevation coverages.