Layer Mask Spec
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)
layers: mask from one or more vector / mask layers. Each LayerMaskLayerConfig references an existing layer id or a known weather com.xweather.mapsgl.weather.LayerCode for auto-created masks.
type: shorthand for built-in water/land masking; LayerMaskType.LAND uses the water mask layer with inverted semantics (land visible where water stencil is clear).
mode: StencilMaskCombineMode.ALL (intersection) vs StencilMaskCombineMode.ANY (union), mirroring JS
mask.mode.invert: optional; when
null, resolution usestruefor land-type shorthand andfalseotherwise (see implementation inMapController).
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
Properties
When non-null, passed through to StencilLayerMaskSpec; when null, defaults depend on type.
Ordered list of mask sources (existing layers or auto-created weather masks).
How multiple mask slots combine in the stencil buffer.
Optional built-in water or land mask in addition to (or instead of) layers.