Package-level declarations

Composables and related utilities to add layers to the map.

Types

Link copied to clipboard
sealed interface Anchor

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

Functions

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

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

Link copied to clipboard
inline fun CircleLayer(id: String, source: Source, sourceLayer: String = "", minZoom: Float = 0.0f, maxZoom: Float = 24.0f, filter: Expression<Boolean> = nil(), visible: Boolean = true, sortKey: Expression<Number> = nil(), translate: Expression<DpOffset> = const(DpOffset.Zero), translateAnchor: Expression<TranslateAnchor> = const(TranslateAnchor.Map), opacity: Expression<Number> = const(1f), color: Expression<Color> = const(Color.Black), blur: Expression<Number> = const(0f), radius: Expression<Dp> = const(5.dp), strokeOpacity: Expression<Number> = const(1f), strokeColor: Expression<Color> = const(Color.Black), strokeWidth: Expression<Dp> = const(0.dp), pitchScale: Expression<CirclePitchScale> = const(CirclePitchScale.Map), pitchAlignment: Expression<CirclePitchAlignment> = const(CirclePitchAlignment.Viewport), noinline onClick: FeaturesClickHandler? = null, noinline 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
inline fun FillExtrusionLayer(id: String, source: Source, sourceLayer: String = "", minZoom: Float = 0.0f, maxZoom: Float = 24.0f, filter: Expression<Boolean> = nil(), visible: Boolean = true, translate: Expression<DpOffset> = const(DpOffset.Zero), translateAnchor: Expression<TranslateAnchor> = const(TranslateAnchor.Map), opacity: Expression<Number> = const(1f), color: Expression<Color> = const(Color.Black), pattern: Expression<TResolvedImage> = nil(), height: Expression<Number> = const(0f), base: Expression<Number> = const(0f), verticalGradient: Expression<Boolean> = const(true), noinline onClick: FeaturesClickHandler? = null, noinline 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
inline fun FillLayer(id: String, source: Source, sourceLayer: String = "", minZoom: Float = 0.0f, maxZoom: Float = 24.0f, filter: Expression<Boolean> = nil(), visible: Boolean = true, sortKey: Expression<Number> = nil(), translate: Expression<DpOffset> = const(DpOffset.Zero), translateAnchor: Expression<TranslateAnchor> = const(TranslateAnchor.Map), opacity: Expression<Number> = const(1f), color: Expression<Color> = const(Color.Black), pattern: Expression<TResolvedImage> = nil(), antialias: Expression<Boolean> = const(true), outlineColor: Expression<Color> = color, noinline onClick: FeaturesClickHandler? = null, noinline 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
inline fun HeatmapLayer(id: String, source: Source, sourceLayer: String = "", minZoom: Float = 0.0f, maxZoom: Float = 24.0f, filter: Expression<Boolean> = nil(), visible: Boolean = true, color: Expression<Color> = Defaults.HeatmapColors, opacity: Expression<Number> = const(1f), radius: Expression<Dp> = const(30.dp), weight: Expression<Number> = const(1f), intensity: Expression<Number> = const(1f), noinline onClick: FeaturesClickHandler? = null, noinline onLongClick: FeaturesClickHandler? = null)

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

Link copied to clipboard
inline fun HillshadeLayer(id: String, source: Source, minZoom: Float = 0.0f, maxZoom: Float = 24.0f, visible: Boolean = true, shadowColor: Expression<Color> = const(Color.Black), highlightColor: Expression<Color> = const(Color.White), accentColor: Expression<Color> = const(Color.Black), illuminationDirection: Expression<Number> = const(355f), illuminationAnchor: Expression<IlluminationAnchor> = const(IlluminationAnchor.Viewport), exaggeration: Expression<Number> = 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
inline fun LineLayer(id: String, source: Source, sourceLayer: String = "", minZoom: Float = 0.0f, maxZoom: Float = 24.0f, filter: Expression<Boolean> = nil(), visible: Boolean = true, sortKey: Expression<Number> = nil(), translate: Expression<DpOffset> = const(DpOffset.Zero), translateAnchor: Expression<TranslateAnchor> = const(TranslateAnchor.Map), opacity: Expression<Number> = const(1f), color: Expression<Color> = const(Color.Black), dasharray: Expression<List<Number>> = nil(), pattern: Expression<TResolvedImage> = nil(), gradient: Expression<Color> = nil(), blur: Expression<Dp> = const(0.dp), width: Expression<Dp> = const(1.dp), gapWidth: Expression<Dp> = const(0.dp), offset: Expression<Dp> = const(0.dp), cap: Expression<LineCap> = const(LineCap.Butt), join: Expression<LineJoin> = const(LineJoin.Miter), miterLimit: Expression<Number> = const(2f), roundLimit: Expression<Number> = const(1.05f), noinline onClick: FeaturesClickHandler? = null, noinline 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
inline fun RasterLayer(id: String, source: Source, minZoom: Float = 0.0f, maxZoom: Float = 24.0f, visible: Boolean = true, opacity: Expression<Number> = const(1f), hueRotate: Expression<Number> = const(0f), brightnessMin: Expression<Number> = const(0f), brightnessMax: Expression<Number> = const(1f), saturation: Expression<Number> = const(0f), contrast: Expression<Number> = const(0f), resampling: Expression<RasterResampling> = const(RasterResampling.Linear), fadeDuration: Expression<Number> = const(300f))

Raster map textures such as satellite imagery.

Link copied to clipboard
inline fun SymbolLayer(id: String, source: Source, sourceLayer: String = "", minZoom: Float = 0.0f, maxZoom: Float = 24.0f, filter: Expression<Boolean> = nil(), visible: Boolean = true, sortKey: Expression<Number> = nil(), placement: Expression<SymbolPlacement> = const(SymbolPlacement.Point), spacing: Expression<Dp> = const(250.dp), avoidEdges: Expression<Boolean> = const(false), zOrder: Expression<SymbolZOrder> = const(SymbolZOrder.Auto), iconImage: Expression<TResolvedImage> = nil(), iconOpacity: Expression<Number> = const(1f), iconColor: Expression<Color> = const(Color.Black), iconHaloColor: Expression<Color> = const(Color.Transparent), iconHaloWidth: Expression<Dp> = const(0.dp), iconHaloBlur: Expression<Dp> = const(0.dp), iconSize: Expression<Number> = const(1f), iconRotationAlignment: Expression<IconRotationAlignment> = const(IconRotationAlignment.Auto), iconPitchAlignment: Expression<IconPitchAlignment> = const(IconPitchAlignment.Auto), iconTextFit: Expression<IconTextFit> = const(IconTextFit.None), iconTextFitPadding: Expression<PaddingValues.Absolute> = const(ZeroPadding), iconKeepUpright: Expression<Boolean> = const(false), iconRotate: Expression<Number> = const(0f), iconAnchor: Expression<SymbolAnchor> = const(SymbolAnchor.Center), iconOffset: Expression<DpOffset> = const(DpOffset.Zero), iconPadding: Expression<Dp> = const(2.dp), iconAllowOverlap: Expression<Boolean> = const(false), iconOverlap: Expression<String> = nil(), iconIgnorePlacement: Expression<Boolean> = const(false), iconOptional: Expression<Boolean> = const(false), iconTranslate: Expression<DpOffset> = const(DpOffset.Zero), iconTranslateAnchor: Expression<TranslateAnchor> = const(TranslateAnchor.Map), textField: Expression<TFormatted> = nil(), textOpacity: Expression<Number> = const(1f), textColor: Expression<Color> = const(Color.Black), textHaloColor: Expression<Color> = const(Color.Transparent), textHaloWidth: Expression<Dp> = const(0.dp), textHaloBlur: Expression<Dp> = const(0.dp), textFont: Expression<List<String>> = Defaults.FontNames, textSize: Expression<Dp> = const(16.dp), textTransform: Expression<TextTransform> = const(TextTransform.None), textLetterSpacing: Expression<Number> = const(0f), textRotationAlignment: Expression<TextRotationAlignment> = const(TextRotationAlignment.Auto), textPitchAlignment: Expression<TextPitchAlignment> = const(TextPitchAlignment.Auto), textMaxAngle: Expression<Number> = const(45f), textMaxWidth: Expression<Number> = const(10f), textLineHeight: Expression<Number> = const(1.2f), textJustify: Expression<TextJustify> = const(TextJustify.Center), textWritingMode: Expression<List<TextWritingMode>> = nil(), textKeepUpright: Expression<Boolean> = const(true), textRotate: Expression<Number> = const(0f), textAnchor: Expression<SymbolAnchor> = const(SymbolAnchor.Center), textOffset: Expression<Offset> = const(Offset.Zero), textVariableAnchor: Expression<List<SymbolAnchor>> = nil(), textRadialOffset: Expression<Number> = const(0f), textVariableAnchorOffset: Expression<List<<Error class: unknown class><SymbolAnchor, Offset>>> = nil(), textPadding: Expression<Dp> = const(2.dp), textAllowOverlap: Expression<Boolean> = const(false), textOverlap: Expression<String> = nil(), textIgnorePlacement: Expression<Boolean> = const(false), textOptional: Expression<Boolean> = const(false), textTranslate: Expression<DpOffset> = const(DpOffset.Zero), textTranslateAnchor: Expression<TranslateAnchor> = const(TranslateAnchor.Map), noinline onClick: FeaturesClickHandler? = null, noinline onLongClick: FeaturesClickHandler? = null)

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