Mvt Vector Layer
Renders Mapbox Vector Tile (MVT) data as flat surface-draped polygons and polylines.
Pipeline: HTTP fetch → protobuf decode → command-stream geometry → Web-Mercator unprojection → batched surface drawables (one VBO+EBO per tile per Globe.State).
Tile management — Web-Mercator screen-space-error quadtree selection, the no-overlap cut with ancestor/descendant fallback, LRU + backoff + revalidation — is owned by MercatorTiledVectorLayer / earth.worldwind.layer.TiledVectorLayer. This class supplies only the MVT specifics: tile decode + toRenderables, zoom-interpolated line widths, and the cross-tile label collision pass.
val mvt = MvtVectorLayer(
source = UrlTemplateMvtTileSource("https://tiles.example.com/v3/{z}/{x}/{y}.pbf"),
style = OpenTopoMapRules,
)
worldWindow.engine.layers.addLayer(mvt)
// ...later:
mvt.close()Constructors
Types
Properties
Tile keys currently in fetch-failure backoff.
See TiledImageLayer.cachedSourceInfo — same shape for MVT vector-tile layers.
Screen-space-error knob: lower = finer (more, smaller on-screen tiles); higher = coarser.
Schema reported by MvtSchemaDetector for the first non-empty decoded tile. null until detection succeeds; re-runs while UNKNOWN to handle empty first-tile responses.
How hard to coarsen the foreshortened far band (Cesium dynamicScreenSpaceError): a horizon tile gets up to (1 + farBandDetailFactor)× the detail factor, so it carries fewer features. 0 disables.
Tiles currently resident in the content cache (visible + fallback).
Cap on launched-but-unfinished fetch Jobs (vs semaphore, which gates concurrent round-trips); bounds the queue so a huge changing cut can't pile up unbounded coroutines + HTTP/SSL → OOM. Over-cap tiles re-request a later frame.
Tiles with a fetch coroutine in flight.
Vector content bounding sector — real data availability can be smaller than the tile grid. Full sphere by default; tiled layers skip tiles outside it. Cache reopen narrows it from the persisted content bbox; bulk download widens and persists it. Mirrors earth.worldwind.globe.elevation.coverage.ElevationCoverage.sector.
When true (default), ring/line geometry is RDP+radial simplified at decode; false passes raw verts through.
Geometry is simplified only at tile zoom <= this (globe/regional scale, where fine detail is sub-pixel and full-detail continental geometry would OOM); at higher zoom (city/street scale) features render full-detail. Applies to both polygon fills and lines.
Optional sprite atlas used to resolve icon-image paint to a per-icon image source. When null, rules with icon paint are silently skipped. Load via MvtSpriteAtlasLoader.load.
Layer-name → ShapeAttributes resolver. Swap to drive a custom appearance.
When true (default), POLYGON features in a tile are packed into one MvtBatchedPolygonTile and LINESTRING features into one MvtBatchedLineTile — one VBO + one EBO per tile per Globe.State, sub-draws bucketed by (color, width). Set false to fall back to per-feature Polygon/Path instances — required when overriding toRenderables to attach per-feature pick metadata or unique attribute mutations the batched path doesn't carry.
How many consecutive frames a different zoom must be observed before switching.
Functions
Makes a fresh copy carrying only this layer's configuration; caches and fetch scope are not shared.
Read all state set for feature. Returns null when no state has been set.
Drop all cached tiles so toRenderables re-runs on the next render. Use after bulk setFeatureState mutations.
Download every MVT tile intersecting sector across the resolution range into the layer's vector-tile store — the "save a region for offline use" flow. Takes the same resolution: ClosedRange<Angle> as TiledImageLayer.launchBulkRetrieval (raster) and TiledElevationCoverage.launchBulkRetrieval (elevation) for a uniform bulk API across layer types; the range is mapped to a slippy zoom range via SlippyTiles.zoomForResolution (nearest-neighbor, matching LevelSet.levelForResolution) and clamped to the layer's MvtVectorLayer.minZoom..MvtVectorLayer.maxZoom.
Set dynamic feature state read by ["feature-state", key] expressions. After mutating state for already-styled features, call invalidate to force re-styling.
See setOfflineOnly on TiledImageLayer. Dispatches by VectorLayer subtype to reach the right source field. No-op for unknown subtypes.
Total number of MVT tiles launchBulkRetrieval would fetch for sector across the resolution range — the slippy analog of LevelSet.tileCount, for sizing a download before committing to it. Uses the same zoom mapping and clamp as launchBulkRetrieval, so the result matches the total later reported to that call's onProgress.