TiledFeatureLayer

open class TiledFeatureLayer(var source: TiledFeatureSource, val levelOffset: Int = 0, val numLevels: Int = 20, val maxLoadedTiles: Int = 256, val maxConcurrentFetches: Int = 4, var shapeAttributes: ShapeAttributes? = null, var autoApplyStyle: Boolean = true, var defaultLineColor: Color? = null, var defaultFillColor: Color? = null, var density: Float = DEFAULT_DENSITY, var labelVisibilityThreshold: Double = DEFAULT_LABEL_VISIBILITY_THRESHOLD, var defaultAltitudeMode: AltitudeMode? = null, var simplifyTolerancePixels: Double = 1.0, val useBatchedRendering: Boolean = true, var customLogicToApplyProperties: Renderable.(LinkedHashMap<String, Any?>) -> Unit = {}, progressiveRefinement: Boolean = false, coarseAncestorFallback: Boolean = true, val maxLoadedTileBytes: Long = DEFAULT_MAX_TILE_BYTES, val maxTileUploadBytesPerFrame: Int = DEFAULT_UPLOAD_BYTES_PER_FRAME, displayName: String? = null) : TiledVectorLayer<List<Renderable>>

Tiled vector-feature layer over a TiledFeatureSource. Each viewport fetches only the tiles it needs (per-tile BBOX GetFeature), caches them, and renders the features via FeatureRenderer (Point → Label/Placemark, LineString → Path, Polygon → Polygon, Multi/GeometryCollection fan out). The cache-through counterpart to BulkFeatureLayer: wrap the source in earth.worldwind.layer.cache.CachedTiledFeatureSource so memory AND network stay bounded.

All the tiling — screen-space-error quadtree selection, the no-overlap cut with ancestor/descendant fallback, the async fetch/cache/backoff/revalidation lifecycle — lives in TiledVectorLayer; this class supplies the geographic tile scheme and the WFS-specific load/render. With useBatchedRendering (default), a tile's polygons are tessellated per-feature into ONE shared VBO/EBO (MvtBatchedPolygonTile fill + MvtBatchedLineTile outline) — O(tiles) per frame, correct per-feature colours, and no cross-feature odd-winding cancellation. Always close it.

Constructors

Link copied to clipboard
constructor(source: TiledFeatureSource, levelOffset: Int = 0, numLevels: Int = 20, maxLoadedTiles: Int = 256, maxConcurrentFetches: Int = 4, shapeAttributes: ShapeAttributes? = null, autoApplyStyle: Boolean = true, defaultLineColor: Color? = null, defaultFillColor: Color? = null, density: Float = DEFAULT_DENSITY, labelVisibilityThreshold: Double = DEFAULT_LABEL_VISIBILITY_THRESHOLD, defaultAltitudeMode: AltitudeMode? = null, simplifyTolerancePixels: Double = 1.0, useBatchedRendering: Boolean = true, customLogicToApplyProperties: Renderable.(LinkedHashMap<String, Any?>) -> Unit = {}, progressiveRefinement: Boolean = false, coarseAncestorFallback: Boolean = true, maxLoadedTileBytes: Long = DEFAULT_MAX_TILE_BYTES, maxTileUploadBytesPerFrame: Int = DEFAULT_UPLOAD_BYTES_PER_FRAME, displayName: String? = null)

Properties

Link copied to clipboard
Link copied to clipboard

Tile keys currently in fetch-failure backoff.

Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard

Screen-space-error knob: lower = finer (more, smaller on-screen tiles); higher = coarser.

Link copied to clipboard
open override var displayName: String?
Link copied to clipboard
open override var isDynamic: Boolean
Link copied to clipboard
open override var isEnabled: Boolean
Link copied to clipboard
open override var isPickEnabled: Boolean
Link copied to clipboard

Quadtree levels coarser than this aren't fetched/rendered — a single coarse tile's BBOX would pull too many features. The layer's effective "zoom band" floor. Level n spans 180°/2^n.

Link copied to clipboard

Tiles currently resident in the content cache (visible + fallback).

Link copied to clipboard
open override var maxActiveAltitude: Double
Link copied to clipboard
Link copied to clipboard

GPU-byte budget for the resident-tile cache. Because full-resolution WFS geometry makes tile VBO/EBOs wildly uneven, a flat tile count (maxLoadedTiles) lets a few dense tiles balloon GPU memory until the driver OOMs (KGSL mmap ENOMEM) while the Java heap still looks empty. A byte budget evicts on real footprint instead. Non-zero here overrides maxLoadedTiles; set 0 to fall back to the count bound.

Link copied to clipboard
Link copied to clipboard

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.

Link copied to clipboard

Max GPU bytes of freshly-fetched tiles admitted to the cache per frame. A pan brings in a burst of tiles whose VBO/EBO uploads otherwise all land in one uploadBuffers call (a multi-hundred-ms frame hitch); this spreads them across frames. 0 disables the throttle.

Link copied to clipboard
open override var minActiveAltitude: Double
Link copied to clipboard
Link copied to clipboard
open override var opacity: Float
Link copied to clipboard

Tiles with a fetch coroutine in flight.

Link copied to clipboard
override val sector: Sector

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.

Link copied to clipboard
Link copied to clipboard

RDP+radial simplify tolerance, in tile texels (≈ screen px at the tile's level), applied to each tile's geometry before tessellation; 0.0 disables. WFS GetFeature returns full-resolution geometry at every zoom (unlike pre-simplified MVT), so the default ~1px drops the sub-pixel detail that would otherwise bloat tile memory and earcut cost without any visible change. Raise for smaller/faster tiles, lower toward 0 to keep every server vertex.

Link copied to clipboard
Link copied to clipboard

Tessellate each tile's polygons into one shared VBO/EBO (fill + outline) instead of one surface shape per feature. O(tiles) per frame; preserves per-feature colours. Set false for the legacy per-feature path.

Functions

Link copied to clipboard
open override fun clone(): TiledFeatureLayer

Makes a fresh copy carrying only this layer's configuration; caches and fetch scope are not shared.

Link copied to clipboard
open fun close()

Cancel in-flight fetches, release GPU buffers, and free the caches. Idempotent.

Link copied to clipboard
open override fun getUserProperty(key: Any): Any?
Link copied to clipboard
open override fun hasUserProperty(key: Any): Boolean
Link copied to clipboard
Link copied to clipboard
open override fun putUserProperty(key: Any, value: Any): Any?
Link copied to clipboard
open override fun removeUserProperty(key: Any): Any?
Link copied to clipboard
open override fun render(rc: RenderContext)
Link copied to clipboard
fun VectorLayer.setOfflineOnly(offlineOnly: Boolean = true)

See setOfflineOnly on TiledImageLayer. Dispatches by VectorLayer subtype to reach the right source field. No-op for unknown subtypes.