Package-level declarations

Types

Link copied to clipboard
data class Anchor(val rawValue: String)

Style-JSON string for icon-anchor / text-anchor (e.g. "center").

Link copied to clipboard
data class AnchorOffset(val x: Double, val y: Double)

Two-component offset serialized as [x, y] for icon-offset / text-offset.

Link copied to clipboard
data class Celcius(val start: Double, val endInclusive: Double) : TypedRange<Double>
Link copied to clipboard
data class CircleLayerPaint(var opacity: Float = 1.0f, var fill: FillPaint = FillPaint(), var stroke: StrokePaint = StrokePaint(), var circle: CirclePaint) : VectorLayerPaint

Paint for com.xweather.mapsgl.layers.spec.CircleLayerDescriptor: disc fill, inset stroke, and radius.

Link copied to clipboard
class CirclePaint(color: StyleValue<Color> = StyleValue.Constant(Color.Red), var radius: StyleValue<Double> = StyleValue.Constant(6.0), var sortKey: StyleValue<Double>? = null, var eventEmitter: LayerEventEmitter? = null) : Paint

Circle disc styling. radius is the outer radius including an inset StrokePaint on CircleLayerPaint. Used by CircleLayerPaint.circle.

Link copied to clipboard
data class CircleStyleSpec(val radius: Int)
Link copied to clipboard
data class ColorEntry(val color: Int, val position: Double, val value: Double)
Link copied to clipboard
class ColorLookupTable(inputStops: List<Any>, val range: ClosedRange<Double>, val interpolate: Boolean = true, val interval: Double = 0.0, var roundDown: Boolean = false)

Color lookup table.

Link copied to clipboard
data class ColorMaskOptions(val channel: ColorBand, val value: Int, val colorscale: ColorScaleOptions = ColorScaleOptions(), val drawRange: ClosedRange<Double>? = null)

Per-band mask entry for a multi-scale colorscale (JS/Apple colorscale.masks).

Link copied to clipboard
data class ColorRampResult(val stops: List<ColorRampResult.Entry>, val valueForPosition: (position: Double) -> Double, val positionForValue: (value: Double) -> Double)

A data class that holds the result of generating a color ramp from a ColorScale. It contains the generated color stops and functions to map between values and positions.

Link copied to clipboard
Link copied to clipboard

A ColorScale maps numeric values to a color palette.

Link copied to clipboard
data class ColorScaleOptions(var stops: List<Any> = emptyList(), var positions: List<Double>? = null, var interval: Double = 0.0, var range: ClosedRange<Double>? = null, var normalized: Boolean = false, var interpolate: Boolean = true, var masks: List<ColorMaskOptions>? = null, var roundDown: Boolean = false)

Color ramp for encoded/sample layers: stops, optional positions, data range, and interpolation flags. Nested masks select a scale from a discrete band (e.g. precip type).

Link copied to clipboard
data class ColorScaleSpec(val stops: List<Number>, val positions: List<Number>, val interval: Int, val range: ValueRange, val normalized: Boolean, val interpolate: Boolean)

Color-scale specification (stops, positions, interval, range) used when building ColorScaleOptions.

Link copied to clipboard
data class ColorStop(val value: Double, val color: Color)
Link copied to clipboard
data class ColorStopLegendDisabled(val value: Double, val color: Color)

Defines a value/color pair for a ColorScale.

Link copied to clipboard
data class ContourLayerPaint(var opacity: Float = 1.0f, var sample: SamplePaint, var contour: ContourPaint) : LayerPaint

Paint for com.xweather.mapsgl.layers.spec.ContourLayerDescriptor: sampled field plus isoline style.

Link copied to clipboard
class ContourPaint(colorScale: ColorScaleOptions = ColorScaleOptions(), var multiband: Boolean = false, var meld: Boolean = true, var eventEmitter: LayerEventEmitter? = null, var interval: StyleValue<Double> = StyleValue.Constant(2.0), var majorInterval: StyleValue<Double> = StyleValue.Constant(10.0), var width: StyleValue<Double> = StyleValue.Constant(1.0), var majorWidth: StyleValue<Double> = StyleValue.Constant(3.0), var scale: StyleValue<Double> = StyleValue.Constant(1.0), var offset: StyleValue<Double> = StyleValue.Constant(0.0)) : Paint

Isoline (contour) styling on top of SamplePaint: interval, major interval, line widths, and value offset / scale. Used by ContourLayerPaint.

Link copied to clipboard
data class ContourStyleSpec(val interval: Int, val majorInterval: Int, val width: Int, val majorWidth: Int, val scale: Int, val offset: Int)
Link copied to clipboard
class DataColorScale(config: Map<String, Any> = emptyMap())
Link copied to clipboard
data class Expression(val raw: Any)

Mapbox style expression wrapper: a JSON-serializable tree (usually a List whose first element is the operator) compatible with the Mapbox expression spec.

Link copied to clipboard
data class ExpressionOperation(val dataRange: ValueRange, val value: (Map<String, Int>) -> Int, val chunk: String)
Link copied to clipboard
data class Fahrenheit(val start: Double, val endInclusive: Double) : TypedRange<Double>
Link copied to clipboard
data class FillLayerPaint(var opacity: Float = 1.0f, var fill: FillPaint, var stroke: StrokePaint? = StrokePaint(thickness = StyleValue.Constant(0.0))) : VectorLayerPaint

Paint for com.xweather.mapsgl.layers.spec.FillLayerDescriptor: polygon fill plus optional outline stroke.

Link copied to clipboard
class FillPaint(color: StyleValue<Color> = StyleValue.Constant(Color.Red), var pattern: StyleValue<String>? = null, var opacity: StyleValue<Double> = StyleValue.Constant(1.0), var eventEmitter: LayerEventEmitter? = null, var sortKey: StyleValue<String>? = null, var sortDirection: SortDirection = SortDirection.ASCENDING) : Paint

Polygon fill color, optional pattern, opacity, and sort key. Used by FillLayerPaint and as the fill block on CircleLayerPaint / SymbolLayerPaint.

Link copied to clipboard
data class FillStyleSpec(val opacity: Double)
Link copied to clipboard
data class GridLayerPaint(var opacity: Float = 1.0f, var fill: FillPaint? = defaultGridFill(), var stroke: StrokePaint? = null, var icon: IconPaint = IconPaint(), var text: List<TextPaint> = emptyList(), var grid: GridPaint = GridPaint(spacing = 20.0), var sample: SamplePaint? = null, var symbol: SymbolPlacementPaint = SymbolPlacementPaint(allowOverlap = StyleValue.Constant(true))) : VectorLayerPaint

Paint for com.xweather.mapsgl.layers.spec.GridLayerDescriptor: sampled encoded values plus instanced icons (arrows/barbs) at a grid spacing.

Link copied to clipboard
class GridPaint(var spacing: Double = 20.0) : Paint

Grid spacing in logical px from style/JS.

Link copied to clipboard
data class GridStyleSpec(val size: Int, val spacing: Int)
Link copied to clipboard
Link copied to clipboard
data class HeatmapPaint(var color: StyleValue<Color> = defaultHeatmapColor(), var intensity: StyleValue<Double> = StyleValue.Constant(1.0), var radius: StyleValue<Double> = StyleValue.Constant(10.0), var weight: StyleValue<Double> = StyleValue.Constant(1.0), var blur: StyleValue<Double> = StyleValue.Constant(1.0)) : Paint

Heatmap kernel styling (Mapbox heatmap-*). Used by HeatmapLayerPaint.

Link copied to clipboard
data class HeatmapStyleSpec(val color: List<Number>, val radius: Int, val blur: Int, val intensity: Int, val weight: Int, val opacity: Double)
Link copied to clipboard
data class IconAtlas(val ids: List<String>, val interval: Double)

Icon atlas (parity with JS icon.atlas / Apple IconAtlasPaint: ordered ids and a data-value interval used to pick an index via floor(value / interval)).

Link copied to clipboard
class IconPaint(allowOverlap: StyleValue<Boolean> = StyleValue.Constant(true), image: StyleValue<String>? = null, size: StyleValue<Double>? = null, iconSize: IconSize? = null, atlas: IconAtlas? = null, anchor: StyleValue<Anchor> = StyleValue.Constant(Anchor.CENTER), offset: StyleValue<AnchorOffset> = StyleValue.Constant(AnchorOffset()), padding: StyleValue<Double> = StyleValue.Constant(0.0), rotation: Double = 0.0, rotationUsesDataDirection: Boolean = false, scale: StyleValue<Double>? = null, type: String? = null, spin: Boolean = false, spinDegreesPerSecond: Float = 180.0f, shader: String? = null, factor: StyleValue<Double>? = null, placement: SymbolPlacementPaint? = null, source: IconSourcePaint? = null) : Paint

Icon style options (Apple IconPaint). Prefer placement / source for new code; named constructor parameters (image, atlas, allowOverlap, …) remain supported for existing call sites.

Link copied to clipboard
class IconSize(width: Float, height: Float)

Width and height in the same units as MapsGL JS icon.size — pixel dimensions for the laid-out symbol quad (see web SymbolStore.layoutIcon: w/h from PaintStyle.iconSize).

Link copied to clipboard
sealed class IconSourcePaint

How an icon image is resolved (Apple IconSourcePaint).

Link copied to clipboard
interface LayerPaint

Layer-level paint: opacity plus type-specific nested paint blocks.

Link copied to clipboard

How the start and end of an open line string are terminated. Maps to Mapbox line-cap and is serialized from StrokePaint.lineCap / LineLayerPaint via StyleJSON.

Link copied to clipboard

How connected line segments meet at a vertex. Maps to Mapbox line-join and is serialized from StrokePaint.lineJoin / LineLayerPaint via StyleJSON.

Link copied to clipboard
data class LineLayerPaint(var opacity: Float = 1.0f, var stroke: StrokePaint) : VectorLayerPaint

Paint model for vector line layers.

Link copied to clipboard
interface Paint

Marker for paint models used in a single render pass (fill, stroke, sample, particle, …).

Link copied to clipboard
interface PaintStyleSpec
Link copied to clipboard

How densely particles are spawned. COUNT uses ParticlePaint.count instead of a density preset.

Link copied to clipboard

Particle glyph: disc, bar, or arrow (JS/Apple particle.type).

Link copied to clipboard
data class ParticleLayerPaint(var opacity: Float = 1.0f, var sample: SamplePaint, var particle: ParticlePaint) : LayerPaint

Paint for com.xweather.mapsgl.layers.spec.ParticleLayerDescriptor: sampled vector field plus particles.

Link copied to clipboard
class ParticlePaint(var kind: ParticleKind = ParticleKind.CIRCLE, var density: ParticleDensity = ParticleDensity.NORMAL, var count: Int = 0, var size: Size = Size(2), var speed: Double = 1.0, var trails: Boolean = true, var trailsFade: Double = 0.97, var dropRate: Double = 0.01, var dropRateBump: Double = 0.01) : Paint

Animated particle field styling (kind, density, size, speed, trails). Used by ParticleLayerPaint together with a SamplePaint that supplies the vector field.

Link copied to clipboard
data class ParticleStyleSpec(val count: Int, val density: ParticleDensity, val size: Int, val speed: Int, val trails: Boolean, val trailsFade: Int, val dropRate: Int, val dropRateBump: Int)
Link copied to clipboard
class ParticleTrailLength(val value: Float)
Link copied to clipboard
Link copied to clipboard

Paint for raster/image tiles (PNG/JPEG). Opacity and other layer-level options live on RasterLayerPaint; this block is the raster-specific slot.

Link copied to clipboard
data class RasterStyleSpec(val opacity: Double)
Link copied to clipboard
data class SampleLayerPaint(var opacity: Float = 1.0f, var sample: SamplePaint) : LayerPaint
Link copied to clipboard
class SamplePaint(var expression: SampleExpression = SampleExpression.NUMBER, var channel: List<ColorBand> = listOf(ColorBand.red), var quality: DataQuality = DataQuality.exact, var interpolation: InterpolationMode = InterpolationMode.BICUBIC, var smoothing: Float = 0.0f, var offset: Float = 0.0f, var drawRange: ClosedRange<Double>? = null, colorScale: ColorScaleOptions = ColorScaleOptions(), var multiband: Boolean = false, var meld: Boolean = true, var encodedScalarNormMax: Double? = null, var eventEmitter: LayerEventEmitter? = null) : Paint, ColorSampling

Paint for sampled encoded-grid values: interpolation, color mapping, draw range, and timeline blending (meld). Used by SampleLayerPaint, ContourLayerPaint, and ParticleLayerPaint.

Link copied to clipboard
data class SampleStyleSpec(val expressionOperation: Partial<ExpressionOperation>, val channel: SampleChannel, val quality: DataQuality, val interpolation: InterpolationMode, val smoothing: Int, val colorscale: Partial<ColorScaleSpec>, val opacity: Double, val multiband: Boolean, val offset: Int, val meld: Boolean, val drawRange: ValueRange)
Link copied to clipboard

Direction a FillPaint.sortKey orders features (Apple SortDirection / Mapbox *-sort-key).

Link copied to clipboard
data class StrokePaint(var color: StyleValue<Color> = StyleValue.Constant(Color.Red), var opacity: StyleValue<Double> = StyleValue.Constant(1.0), var thickness: StyleValue<Double> = StyleValue.Constant(1.0), var lineJoin: StyleValue<LineJoin> = StyleValue.Constant(LineJoin.ROUND), var lineCap: StyleValue<LineCap> = StyleValue.Constant(LineCap.ROUND), var miterLimit: StyleValue<Double> = StyleValue.Constant(2.0)) : Paint

Stroke style shared by line-capable paint types (for example LineLayerPaint, FillLayerPaint.stroke, and CircleLayerPaint.stroke).

Link copied to clipboard
data class StrokeStyleSpec(val opacity: Double, val thickness: Int, val lineJoin: LineJoin)
Link copied to clipboard
sealed class StyleColor

Color value accepted in style serialization: Compose Color, hex, or rgba(...) string.

Link copied to clipboard
sealed class StyleValue<out T>

Paint or layout property value: either a constant literal or a Mapbox-style expression.

Link copied to clipboard
data class SymbolLayerPaint(var opacity: Float = 1.0f, var fill: FillPaint? = null, var stroke: StrokePaint? = null, var icon: IconPaint = IconPaint(), var text: List<TextPaint> = emptyList(), var rank: SymbolRank? = null, var pitchWithMap: Boolean = true, var rotateWithMap: Boolean = true) : VectorLayerPaint

Paint for com.xweather.mapsgl.layers.spec.SymbolLayerDescriptor: icon, optional text list, fill/stroke, rank.

Link copied to clipboard
data class SymbolPlacementPaint(var allowOverlap: StyleValue<Boolean> = StyleValue.Constant(false), var anchor: StyleValue<Anchor> = StyleValue.Constant(Anchor.CENTER), var offset: StyleValue<AnchorOffset> = StyleValue.Constant(AnchorOffset()), var padding: StyleValue<Double> = StyleValue.Constant(0.0), var rotation: StyleValue<Double> = StyleValue.Constant(0.0), var rotateWithMap: Boolean = false, var pitchWithMap: Boolean = false)

Shared symbol placement options (Apple SymbolPlacementPaint). Used by IconPaint.placement and GridLayerPaint.symbol.

Link copied to clipboard
data class SymbolRank(val property: String, val direction: SymbolRankDirection = SymbolRankDirection.ASC)

MapsGL JS symbol.rank: feature property used to order symbols before placement / draw.

Link copied to clipboard

Sort direction for SymbolRank.property (JS symbol.rank.direction).

Link copied to clipboard
data class SymbolStyleSpec(val size: Size, val offset: Point, val rotation: Double, val animated: Boolean, val shader: String, val uniforms: Map<String, Any>, val factor: Double, val pitchWithMap: Boolean, val rotateWithMap: Boolean, val billboard: Boolean, val atlas: TextureAtlas)
Link copied to clipboard
data class TextFormatOptions(var fontScale: Double? = null, var textFont: List<String>? = null, var textColor: Color? = null)

Per-span formatting options for Mapbox format expressions built with Expression.Companion.format.

Link copied to clipboard
data class TextJustification(val rawValue: String)

Style-JSON string for text-justify (e.g. "center").

Link copied to clipboard
data class TextPaint(var allowOverlap: StyleValue<Boolean> = StyleValue.Constant(false), var value: StyleValue<String>, var size: StyleValue<Double>? = null, var font: StyleValue<List<String>>? = null, var weight: StyleValue<String>? = null, var color: StyleValue<Color> = StyleValue.Constant(Color.Black), var outlineColor: StyleValue<Color>? = null, var opacity: StyleValue<Double> = StyleValue.Constant(1.0), var align: StyleValue<TextJustification> = StyleValue.Constant(TextJustification.CENTER), var transform: StyleValue<TextTransform> = StyleValue.Constant(TextTransform.NONE), var anchor: StyleValue<Anchor> = StyleValue.Constant(Anchor.CENTER), var offset: StyleValue<AnchorOffset> = StyleValue.Constant(AnchorOffset(0.0, 0.0)), var padding: StyleValue<Double> = StyleValue.Constant(0.0), var rotation: StyleValue<Double> = StyleValue.Constant(0.0), var letterSpacing: StyleValue<Double>? = null, var lineHeight: StyleValue<Double>? = null, var maxWidth: StyleValue<Double>? = null) : Paint

Text styling for symbol layers (Mapbox text-* properties). Multiple TextPaint entries on SymbolLayerPaint.text become stacked labels.

Link copied to clipboard
interface TextStyleSpec
Link copied to clipboard
data class TextTransform(val rawValue: String)

Style-JSON string for text-transform (e.g. "uppercase").

Link copied to clipboard
data class TextureAtlas(val columns: Int, val rows: Int, val interval: Int, val sdfMax: ValueRange?, val sdfSoft: ValueRange?)
Link copied to clipboard
data class TextureAtlasItem(val x: Int, val y: Int, val width: Int, val height: Int, val anchorX: Int, val anchorY: Int, val mask: Boolean)
Link copied to clipboard
open class TypedRange<T>(val start: Double, val endInclusive: Double) : ClosedRange<Double>
Link copied to clipboard

Vector (fill/line/circle/symbol/heatmap) paint that can emit Mapbox StyleJSON via asStyleJSON.

Properties

Link copied to clipboard
val SupportedSymbolAnchors: <Error class: unknown class>
Link copied to clipboard
const val TAG: String

Functions

Link copied to clipboard

Color LUT / sampleDataMin/sampleDataMax span for encoded layers. VECTOR wind speed is non-negative; u/v decoding uses the dataset range in the renderer.

Link copied to clipboard

If stops is multiband (listOf(band0, band1, …) each band a list of ColorStop), returns those bands. Otherwise null (flat single-band list).

Link copied to clipboard

ColorScaleOptions.stops is either a flat List of ColorStop (typical encoded layers) or, for multiband radar, a list of per-band stop lists. CPU ColorScale and bar legends use the first band (reflectivity / red), matching TileLayerRenderer multiband sampling.

Link copied to clipboard

Timeline blend factor for sampling / draw. Returns 0 when sampleMeldEnabled is false (JS: sampleMeld() ? progress : 0).

Link copied to clipboard
Link copied to clipboard
fun lerp(start: Double, stop: Double, fraction: Double): Double
Link copied to clipboard
fun makeJSONObject(value: Any?): Any?

Converts a Kotlin style value to a JSON-ready form for Mapbox style payloads and debugging.

Link copied to clipboard
Link copied to clipboard
Link copied to clipboard

JS paint.sample.meld — whether this layer's SamplePaint blends across timeline intervals. Defaults to true when the paint has no sample block.

Link copied to clipboard
Link copied to clipboard

Compose Color as rgba(r,g,b,a) with RGB 0–255 and alpha 0–1.