FillLayerDescriptor

data class FillLayerDescriptor(var id: String, var source: String, var sourceLayer: String? = null, var paint: FillLayerPaint = FillLayerPaint( fill = FillPaint(), stroke = StrokePaint() ), var filter: Expression? = null, var stencilOnly: Boolean = false) : VectorLayerDescriptor<FillLayerPaint> , LayerEventEmitter

Descriptor for a Mapbox fill layer: polygon features filled with optional outline, backed by a vector or GeoJSON source.

Add the source with com.xweather.mapsgl.map.MapController.addSource, then register this descriptor via com.xweather.mapsgl.map.MapController.addLayer. Renders as a VectorTileLayer using Mapbox’s native fill layer.

For vector tiles, set sourceLayer to the MVT layer containing polygons. For GeoJSON, use null on sourceLayer so the whole collection is used. filter restricts which features participate.

See also

Constructors

Link copied to clipboard
constructor(id: String, source: String, sourceLayer: String? = null, paint: FillLayerPaint = FillLayerPaint( fill = FillPaint(), stroke = StrokePaint() ), filter: Expression? = null, stencilOnly: Boolean = false)

Properties

Link copied to clipboard
open override var filter: Expression?

Optional Mapbox filter expression.

Link copied to clipboard
open override var id: String

Unique layer id within the controller.

Link copied to clipboard
open override var paint: FillLayerPaint

Fill color and opacity. Outline is drawn on a companion Mapbox line layer ({layerId}::stroke); width comes from com.xweather.mapsgl.style.FillLayerPaint.scaleOutlineThickness.

Link copied to clipboard
open override var source: String

Id of an existing vector or GeoJSON source.

Link copied to clipboard
open override var sourceLayer: String?

MVT layer name, or null for GeoJSON-only sources.

Link copied to clipboard
open override var stencilOnly: Boolean

When true, MapsGL does not register a Mapbox fill / line / circle / symbol / heatmap style layer. The com.xweather.mapsgl.layers.tile.VectorTileLayer still exists for tile/GeoJSON consumers, MVT fetch (e.g. com.xweather.mapsgl.map.mapbox.GlStencilCustomMaskCoordinator), and GLES stencil mesh build in com.xweather.mapsgl.renderers.TileLayerRenderer — only screen drawing via Mapbox paint is skipped.

Link copied to clipboard
open override val type: LayerType

Functions

Link copied to clipboard
open override fun off(eventName: String)
Link copied to clipboard
open override fun on(eventName: String, callback: (Any?) -> Unit)
Link copied to clipboard
open override fun trigger(eventName: String, data: Any?)