BulkFeatureLayer

open class BulkFeatureLayer(var source: BulkFeatureSource, displayName: String? = null, 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 customLogicToApplyProperties: Renderable.(LinkedHashMap<String, Any?>) -> Unit = {}) : RenderableLayer, VectorLayer

Vector-feature layer driven by a BulkFeatureSource. The source delivers (geometry, properties_json) rows from one of:

"Bulk" because one source fetch pulls every feature in the layer; there is no per-tile addressing. Compare:

Styling fires twice per feature when autoApplyStyle is true (default): first applyFeatureStyle reads GeoJSON simplestyle keys (stroke, fill, icon, etc.) onto the renderable, then customLogicToApplyProperties runs and can override anything. Disable with autoApplyStyle = false when the source emits properties that aren't simplestyle and you don't want the no-match defaults applied.

Point features become a Label when the resolved feature name is non-blank and the icon property is absent; otherwise a Placemark. LineStrings become Paths, Polygons become Polygons, MultiPolygons fan out to N Polygons sharing one properties map.

Constructors

Link copied to clipboard
constructor(source: BulkFeatureSource, displayName: String? = null, 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, customLogicToApplyProperties: Renderable.(LinkedHashMap<String, Any?>) -> Unit = {})

Properties

Link copied to clipboard

Apply applyFeatureStyle from the feature's properties before customLogicToApplyProperties runs. Off for sources whose properties are pure data with no styling intent (some WFS endpoints).

Link copied to clipboard

Debounce after the viewport settles before reading, when autoRefreshViewport is on.

Link copied to clipboard

Fraction the visible sector is padded by on each side before reading (hysteresis).

Link copied to clipboard

When true, each frame reads only the visible viewport via BulkFeatureSource.readBySector instead of loading everything via load. Pair with a cache-backed source (CachedBulkFeatureSource over a GeoPackage store): downloaded once, then every pan/zoom is a BBOX query off its spatial index so RAM holds only visible features. A plain network source has no index — its default readBySector falls back to fetchAll, so memory isn't bounded.

Link copied to clipboard
Link copied to clipboard
val count: Int
Link copied to clipboard

Force every emitted renderable's altitude mode. null (default) picks AltitudeMode.ABSOLUTE when the cached geometry has any non-null z, else AltitudeMode.CLAMP_TO_GROUND. Set explicitly when the source has z values that shouldn't be rendered as altitude (e.g. shapefile measure-z, GeoJSON elevation values you want flattened).

Link copied to clipboard

Fallback fill colour written when a feature has no fill property. Same null semantics as defaultLineColor.

Link copied to clipboard

Fallback line colour written when a feature has no stroke property. null (default) leaves the renderable's existing outline alone — preserves the layer's shapeAttributes template (e.g. Shapefile's translucent fill) when the source has no simplestyle keys.

Link copied to clipboard

Multiplier applied to placemark icon scale — pass per-display density to keep icons consistent across DPI. Default 1.0f leaves scale unchanged.

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

Visibility threshold (eye-distance, meters) set on every emitted Label. 0.0 (default) keeps labels visible at any distance.

Link copied to clipboard
open override var maxActiveAltitude: Double
Link copied to clipboard
open override var minActiveAltitude: Double
Link copied to clipboard
open override var opacity: Float
Link copied to clipboard
open 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

Default ShapeAttributes applied to every Polygon / Path this layer builds. null leaves the renderable at its own default (white fill, black outline). Set this to colour an entire layer in one go without writing a per-feature lambda — the per- feature customLogicToApplyProperties still gets a chance to override attributes after this default is installed.

Link copied to clipboard

Functions

Link copied to clipboard
Link copied to clipboard
fun addRenderable(renderable: Renderable)
fun addRenderable(index: Int, renderable: Renderable)
Link copied to clipboard
Link copied to clipboard
open override fun clone(): BulkFeatureLayer

Makes a fresh copy carrying this layer's configuration; source, renderables, and refresh driver are not shared.

Link copied to clipboard
open fun close()

Release the source's resources (e.g. its reused HTTP client) and stop auto-refresh. Call when discarding the layer so a network-backed source doesn't leak its client. Idempotent.

Link copied to clipboard
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
fun indexOfRenderable(renderable: Renderable): Int
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
open operator override fun iterator(): MutableIterator<Renderable>
Link copied to clipboard
open suspend fun load()

Pull rows from source and atomically replace this layer's renderables. Accumulates the full set before swapping in to avoid mid-load flicker (paginated WFS responses still complete in one swap). Per renderable: install applyFeatureStyle defaults if autoApplyStyle, then run customLogicToApplyProperties.

Link copied to clipboard
open override fun putUserProperty(key: Any, value: Any): Any?
Link copied to clipboard
Link copied to clipboard
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.

Link copied to clipboard
fun setRenderable(index: Int, renderable: Renderable): Renderable