createLayer

suspend fun createLayer(serviceAddress: String, typeName: String, serviceMetadata: String? = null, displayName: String? = null, sector: Sector? = null, maxFeatures: Int? = null, cqlFilter: String? = null, sortBy: String? = null, customLogicToApplyProperties: Renderable.(LinkedHashMap<String, Any?>) -> Unit = {}, pageSize: Int? = null, clientConfig: HttpClientConfig<*>.() -> Unit = {}, httpClient: HttpClient? = null): RenderableLayer

Create a renderable layer for one WFS feature type. Capabilities are fetched from the server (or supplied via serviceMetadata), an output format is negotiated, and the GetFeature response is decoded into Renderables.

Parameters

serviceAddress

WFS service address

typeName

WFS feature type name to be requested

serviceMetadata

Optional WFS capabilities XML string to avoid online capabilities request

displayName

Optional layer display name

sector

Optional bounding box filter (BBOX); defaults to the feature type's WGS84BoundingBox

maxFeatures

Optional limit on the number of features fetched (translated to the WFS 2.0 count parameter)

cqlFilter

Optional CQL_FILTER expression evaluated server-side (GeoServer / MapServer / QGIS Server extension)

customLogicToApplyProperties

Optional callback invoked once per feature with the created renderable as this and the feature's properties as the argument — use it to style placemarks/paths/polygons from server-side attributes. Works uniformly for the GeoJSON and GML decode paths.

pageSize

Optional WFS 2.0 page size. When set the factory issues repeated GetFeature requests with STARTINDEX, accumulating into a single layer, until the server returns a short page or maxFeatures is reached. Ignored for WFS 1.1.0 endpoints (the spec lacks STARTINDEX before 2.0); pass maxFeatures alone for those.

clientConfig

Optional HttpClientConfig customizer applied to every Ktor client created here — use it to install basic auth, a bearer token, custom headers, or other request-shaping behaviour required by private endpoints.