Package-level declarations

Composables and related utilities to add layers to the map.

Types

Link copied to clipboard
@Immutable
sealed interface Anchor

Declares where the layers should be anchored, i.e. positioned in the list of layers in the map style.

Link copied to clipboard

Functions

Link copied to clipboard
@Composable
fun BackgroundLayer(id: String, minZoom: Float = 0.0f, maxZoom: Float = 24.0f, visible: Boolean = true, opacity: Expression<FloatValue> = const(1f), color: Expression<ColorValue> = const(Color.Black), pattern: Expression<ImageValue> = nil())

The background layer just draws the map background, by default, plain black.

Link copied to clipboard
@Composable
fun CircleLayer(id: String, source: Source, sourceLayer: String = "", minZoom: Float = 0.0f, maxZoom: Float = 24.0f, filter: Expression<BooleanValue> = nil(), visible: Boolean = true, sortKey: Expression<FloatValue> = nil(), translate: Expression<DpOffsetValue> = const(DpOffset.Zero), translateAnchor: Expression<TranslateAnchor> = const(TranslateAnchor.Map), opacity: Expression<FloatValue> = const(1f), color: Expression<ColorValue> = const(Color.Black), blur: Expression<FloatValue> = const(0f), radius: Expression<DpValue> = const(5.dp), strokeOpacity: Expression<FloatValue> = const(1f), strokeColor: Expression<ColorValue> = const(Color.Black), strokeWidth: Expression<DpValue> = const(0.dp), pitchScale: Expression<CirclePitchScale> = const(CirclePitchScale.Map), pitchAlignment: Expression<CirclePitchAlignment> = const(CirclePitchAlignment.Viewport), onClick: FeaturesClickHandler? = null, onLongClick: FeaturesClickHandler? = null)

A circle layer draws points from the sourceLayer in the given source in the given style as a circles. If nothing else is specified, these will be black dots of 5 dp radius.

Link copied to clipboard
@Composable
fun FillExtrusionLayer(id: String, source: Source, sourceLayer: String = "", minZoom: Float = 0.0f, maxZoom: Float = 24.0f, filter: Expression<BooleanValue> = nil(), visible: Boolean = true, translate: Expression<DpOffsetValue> = const(DpOffset.Zero), translateAnchor: Expression<TranslateAnchor> = const(TranslateAnchor.Map), opacity: Expression<FloatValue> = const(1f), color: Expression<ColorValue> = const(Color.Black), pattern: Expression<ImageValue> = nil(), height: Expression<FloatValue> = const(0f), base: Expression<FloatValue> = const(0f), verticalGradient: Expression<BooleanValue> = const(true), onClick: FeaturesClickHandler? = null, onLongClick: FeaturesClickHandler? = null)

A fill extrusion layer draws polygons from the sourceLayer in the given source in the given style as a series of extruded polygon fills, i.e. a polygon with a certain extent on the z-axis. If nothing else is specified, these 3D polygons will be black and flat.

Link copied to clipboard
@Composable
fun FillLayer(id: String, source: Source, sourceLayer: String = "", minZoom: Float = 0.0f, maxZoom: Float = 24.0f, filter: Expression<BooleanValue> = nil(), visible: Boolean = true, sortKey: Expression<FloatValue> = nil(), translate: Expression<DpOffsetValue> = const(DpOffset.Zero), translateAnchor: Expression<TranslateAnchor> = const(TranslateAnchor.Map), opacity: Expression<FloatValue> = const(1f), color: Expression<ColorValue> = const(Color.Black), pattern: Expression<ImageValue> = nil(), antialias: Expression<BooleanValue> = const(true), outlineColor: Expression<ColorValue> = color, onClick: FeaturesClickHandler? = null, onLongClick: FeaturesClickHandler? = null)

A fill layer draws polygons from the sourceLayer in the given source in the given style as a series of polygon fills. If nothing else is specified, these will be black.

Link copied to clipboard
@Composable
fun HeatmapLayer(id: String, source: Source, sourceLayer: String = "", minZoom: Float = 0.0f, maxZoom: Float = 24.0f, filter: Expression<BooleanValue> = nil(), visible: Boolean = true, color: Expression<ColorValue> = LayerDefaults.HeatmapColors, opacity: Expression<FloatValue> = const(1f), radius: Expression<DpValue> = const(30.dp), weight: Expression<FloatValue> = const(1f), intensity: Expression<FloatValue> = const(1f), onClick: FeaturesClickHandler? = null, onLongClick: FeaturesClickHandler? = null)

A heatmap layer draws points from the sourceLayer in the given source as a heatmap.

Link copied to clipboard
@Composable
fun HillshadeLayer(id: String, source: Source, minZoom: Float = 0.0f, maxZoom: Float = 24.0f, visible: Boolean = true, shadowColor: Expression<ColorValue> = const(Color.Black), highlightColor: Expression<ColorValue> = const(Color.White), accentColor: Expression<ColorValue> = const(Color.Black), illuminationDirection: Expression<FloatValue> = const(355f), illuminationAnchor: Expression<IlluminationAnchor> = const(IlluminationAnchor.Viewport), exaggeration: Expression<FloatValue> = const(0.5f))

Client-side hillshading visualization based on DEM data. The implementation supports Mapbox Terrain RGB, Mapzen Terrarium tiles and custom encodings.

Link copied to clipboard
@Composable
fun LineLayer(id: String, source: Source, sourceLayer: String = "", minZoom: Float = 0.0f, maxZoom: Float = 24.0f, filter: Expression<BooleanValue> = nil(), visible: Boolean = true, sortKey: Expression<FloatValue> = nil(), translate: Expression<DpOffsetValue> = const(DpOffset.Zero), translateAnchor: Expression<TranslateAnchor> = const(TranslateAnchor.Map), opacity: Expression<FloatValue> = const(1f), color: Expression<ColorValue> = const(Color.Black), dasharray: Expression<VectorValue<Number>> = nil(), pattern: Expression<ImageValue> = nil(), gradient: Expression<ColorValue> = nil(), blur: Expression<DpValue> = const(0.dp), width: Expression<DpValue> = const(1.dp), gapWidth: Expression<DpValue> = const(0.dp), offset: Expression<DpValue> = const(0.dp), cap: Expression<LineCap> = const(LineCap.Butt), join: Expression<LineJoin> = const(LineJoin.Miter), miterLimit: Expression<FloatValue> = const(2f), roundLimit: Expression<FloatValue> = const(1.05f), onClick: FeaturesClickHandler? = null, onLongClick: FeaturesClickHandler? = null)

A line layer draws polylines and polygons from the sourceLayer in the given source in the given style as a series of lines and outlines, respectively. If nothing else is specified, these will be black lines of 1 dp width.

Link copied to clipboard
@Composable
fun RasterLayer(id: String, source: Source, minZoom: Float = 0.0f, maxZoom: Float = 24.0f, visible: Boolean = true, opacity: Expression<FloatValue> = const(1f), hueRotate: Expression<FloatValue> = const(0f), brightnessMin: Expression<FloatValue> = const(0f), brightnessMax: Expression<FloatValue> = const(1f), saturation: Expression<FloatValue> = const(0f), contrast: Expression<FloatValue> = const(0f), resampling: Expression<RasterResampling> = const(RasterResampling.Linear), fadeDuration: Expression<MillisecondsValue> = const(300.milliseconds))

Raster map textures such as satellite imagery.

Link copied to clipboard
@Composable
fun SymbolLayer(id: String, source: Source, sourceLayer: String = "", minZoom: Float = 0.0f, maxZoom: Float = 24.0f, filter: Expression<BooleanValue> = nil(), visible: Boolean = true, sortKey: Expression<FloatValue> = nil(), placement: Expression<SymbolPlacement> = const(SymbolPlacement.Point), spacing: Expression<DpValue> = const(250.dp), avoidEdges: Expression<BooleanValue> = const(false), zOrder: Expression<SymbolZOrder> = const(SymbolZOrder.Auto), iconImage: Expression<ImageValue> = nil(), iconOpacity: Expression<FloatValue> = const(1f), iconColor: Expression<ColorValue> = const(Color.Black), iconHaloColor: Expression<ColorValue> = const(Color.Transparent), iconHaloWidth: Expression<DpValue> = const(0.dp), iconHaloBlur: Expression<DpValue> = const(0.dp), iconSize: Expression<FloatValue> = const(1f), iconRotationAlignment: Expression<IconRotationAlignment> = const(IconRotationAlignment.Auto), iconPitchAlignment: Expression<IconPitchAlignment> = const(IconPitchAlignment.Auto), iconTextFit: Expression<IconTextFit> = const(IconTextFit.None), iconTextFitPadding: Expression<DpPaddingValue> = const(PaddingValues.Absolute(0.dp)), iconKeepUpright: Expression<BooleanValue> = const(false), iconRotate: Expression<FloatValue> = const(0f), iconAnchor: Expression<SymbolAnchor> = const(SymbolAnchor.Center), iconOffset: Expression<DpOffsetValue> = const(DpOffset.Zero), iconPadding: Expression<DpPaddingValue> = const(PaddingValues.Absolute(2.dp, 2.dp, 2.dp, 2.dp)), iconAllowOverlap: Expression<BooleanValue> = const(false), iconOverlap: Expression<StringValue> = nil(), iconIgnorePlacement: Expression<BooleanValue> = const(false), iconOptional: Expression<BooleanValue> = const(false), iconTranslate: Expression<DpOffsetValue> = const(DpOffset.Zero), iconTranslateAnchor: Expression<TranslateAnchor> = const(TranslateAnchor.Map), textField: Expression<FormattedValue> = const("").cast(), textOpacity: Expression<FloatValue> = const(1f), textColor: Expression<ColorValue> = const(Color.Black), textHaloColor: Expression<ColorValue> = const(Color.Transparent), textHaloWidth: Expression<DpValue> = const(0.dp), textHaloBlur: Expression<DpValue> = const(0.dp), textFont: Expression<ListValue<StringValue>> = LayerDefaults.FontNames, textSize: Expression<TextUnitValue> = const(1.em), textTransform: Expression<TextTransform> = const(TextTransform.None), textLetterSpacing: Expression<TextUnitValue> = const(0f.em), textRotationAlignment: Expression<TextRotationAlignment> = const(TextRotationAlignment.Auto), textPitchAlignment: Expression<TextPitchAlignment> = const(TextPitchAlignment.Auto), textMaxAngle: Expression<FloatValue> = const(45f), textMaxWidth: Expression<TextUnitValue> = const(10f.em), textLineHeight: Expression<TextUnitValue> = const(1.2f.em), textJustify: Expression<TextJustify> = const(TextJustify.Center), textWritingMode: Expression<ListValue<TextWritingMode>> = nil(), textKeepUpright: Expression<BooleanValue> = const(true), textRotate: Expression<FloatValue> = const(0f), textAnchor: Expression<SymbolAnchor> = const(SymbolAnchor.Center), textOffset: Expression<TextUnitOffsetValue> = offset(0f.em, 0f.em), textVariableAnchor: Expression<ListValue<SymbolAnchor>> = nil(), textRadialOffset: Expression<TextUnitValue> = const(0f.em), textVariableAnchorOffset: Expression<Nothing> = nil(), textPadding: Expression<DpValue> = const(2.dp), textAllowOverlap: Expression<BooleanValue> = const(false), textOverlap: Expression<SymbolOverlap> = nil(), textIgnorePlacement: Expression<BooleanValue> = const(false), textOptional: Expression<BooleanValue> = const(false), textTranslate: Expression<DpOffsetValue> = const(DpOffset.Zero), textTranslateAnchor: Expression<TranslateAnchor> = const(TranslateAnchor.Map), onClick: FeaturesClickHandler? = null, onLongClick: FeaturesClickHandler? = null)

A symbol layer draws data from the sourceLayer in the given source as icons and/or text labels.