CircleLayerDescriptor

data class CircleLayerDescriptor(var id: String, var source: String, var sourceLayer: String? = null, var paint: CircleLayerPaint = CircleLayerPaint( fill = FillPaint(), stroke = StrokePaint(), circle = CirclePaint() ), var filter: Expression? = null) : VectorLayerDescriptor<CircleLayerPaint> , LayerEventEmitter

Descriptor for a Mapbox circle layer: points rendered as filled disks with optional stroke, driven by a vector or GeoJSON source.

Register the backing source first (com.xweather.mapsgl.map.MapController.addSource), then add this layer with com.xweather.mapsgl.map.MapController.addLayer. The layer is implemented as a VectorTileLayer over Mapbox’s native circle layer.

Sources

Paint is held in paint (CircleLayerPaint): fill color, stroke, and circle radius map to Mapbox circle-color, circle-radius, circle-stroke-*, etc. Use com.xweather.mapsgl.style.StyleValue and Expression for data-driven styling (e.g. magnitude-based radius).

Stacking: the beforeID argument to com.xweather.mapsgl.map.MapController.addLayer controls insertion order relative to existing style layers (see that method’s KDoc).

See also

Constructors

Link copied to clipboard
constructor(id: String, source: String, sourceLayer: String? = null, paint: CircleLayerPaint = CircleLayerPaint( fill = FillPaint(), stroke = StrokePaint(), circle = CirclePaint() ), filter: Expression? = null)

Properties

Link copied to clipboard
open override var filter: Expression?

Optional Mapbox filter expression; combined with source-layer filtering when sourceLayer is set.

Link copied to clipboard
open override var id: String

Stable layer identifier; must be unique within the map controller.

Link copied to clipboard
open override var paint: CircleLayerPaint

Circle fill, stroke, and geometry styling converted to Mapbox style JSON.

Link copied to clipboard
open override var source: String

Identifier of an already-added source whose features this layer draws.

Link copied to clipboard
open override var sourceLayer: String?

For vector tiles, the source layer name inside the MVT; for GeoJSON-only sources, use null.

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?)