WfsLayer

class WfsLayer(serviceAddress: String, typeName: String, displayName: String? = null, cqlFilter: String? = null, customLogicToApplyProperties: Renderable.(LinkedHashMap<String, Any?>) -> Unit = {}, pageSize: Int? = null, clientConfig: HttpClientConfig<*>.() -> Unit = {}, driver: ViewportRefreshDriver = ViewportRefreshDriver()) : RenderableLayer

A RenderableLayer whose contents are sourced from an OGC WFS endpoint and can be re-fetched at will. Use this when the underlying feature set is too large to fetch once — call refresh yourself with the current viewport Sector, or set autoRefresh and let the layer re-fetch the visible extent automatically during render (BBOX-bounded, so only features inside the visible globe extent are loaded).

Each fetch internally invokes WfsLayerFactory.createLayer (so capabilities negotiation, output-format selection, OWS exception handling, and GeoJSON/GML decoding all flow through the same code path) and atomically swaps the renderables.

Auto-refresh is render-driven (the same pattern as earth.worldwind.layer.mvt.MvtVectorLayer and earth.worldwind.layer.buildings.OsmBuildingsLayer) rather than wired to a navigator-change listener: doRender hands rc.terrain.sector to a ViewportRefreshDriver, which debounces and runs the fetch off the render thread, then swaps the result in. This always hits the network — for a download-once, read-by-viewport cache use a BulkFeatureLayer with a GeoPackage-backed source and autoRefreshViewport.

Constructors

Link copied to clipboard
constructor(serviceAddress: String, typeName: String, displayName: String? = null, cqlFilter: String? = null, customLogicToApplyProperties: Renderable.(LinkedHashMap<String, Any?>) -> Unit = {}, pageSize: Int? = null, clientConfig: HttpClientConfig<*>.() -> Unit = {}, driver: ViewportRefreshDriver = ViewportRefreshDriver())

Properties

Link copied to clipboard

When true, doRender re-fetches features for the visible viewport automatically. Always pair with autoRefreshMaxFeatures to bound memory on dense layers.

Link copied to clipboard

Wait this long after the viewport stops changing before firing an auto-refresh.

Link copied to clipboard

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

Link copied to clipboard

Per-fetch server-side feature cap applied during autoRefresh (WFS COUNT/MAXFEATURES). null lets the server return every feature inside the BBOX — leave set on large layers.

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

Functions

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

Cancel any in-flight auto-refresh, tear down the driver's scope, and release the HTTP client. Call when discarding the layer so a background fetch doesn't outlive it.

Link copied to clipboard
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 override fun putUserProperty(key: Any, value: Any): Any?
Link copied to clipboard
suspend fun refresh(sector: Sector? = null, maxFeatures: Int? = null)

Fetch features for the given sector (or the feature type's full WGS84 bounding box if null) and atomically replace this layer's renderables. Suspends until the fetch completes; drive it yourself from a navigator handler, or use autoRefresh.

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 setRenderable(index: Int, renderable: Renderable): Renderable