LayerMaskSpec

data class LayerMaskSpec(val layers: List<LayerMaskLayerConfig> = emptyList(), val type: LayerMaskType? = null, val mode: StencilMaskCombineMode = StencilMaskCombineMode.ALL, val invert: Boolean? = null)

JavaScript SDK–style mask configuration for weather layers on Android.

Set this on supported bitmap-style descriptors (RasterLayerDescriptor, SampleLayerDescriptor, ContourLayerDescriptor, ParticleLayerDescriptor, GridLayerDescriptor) as layerMask. When com.xweather.mapsgl.map.MapController.addWeatherLayer resolves it to a StencilLayerMaskSpec (explicit stencil layer refs, combine mode, invert).

Semantics (aligned with JS)

Limits: resolution keeps at most StencilLayerMaskSpec.MAX_STENCIL_MASK_LAYERS distinct mask layers; extras are dropped with a log line.

At least one of layers or type must be non-null / non-empty (enforced in init).

See also

Constructors

Link copied to clipboard
constructor(layers: List<LayerMaskLayerConfig> = emptyList(), type: LayerMaskType? = null, mode: StencilMaskCombineMode = StencilMaskCombineMode.ALL, invert: Boolean? = null)

Properties

Link copied to clipboard
val invert: Boolean? = null

When non-null, passed through to StencilLayerMaskSpec; when null, defaults depend on type.

Link copied to clipboard

Ordered list of mask sources (existing layers or auto-created weather masks).

Link copied to clipboard

How multiple mask slots combine in the stencil buffer.

Link copied to clipboard
val type: LayerMaskType? = null

Optional built-in water or land mask in addition to (or instead of) layers.