PointLegend

data class PointLegend(val id: String, var title: String? = null, val labelFontWeight: FontWeight = FontWeight.Normal, var titleFontSize: TextUnit = LegendDefaults.titleFontSize, var titleFontWeight: FontWeight = LegendDefaults.titleFontWeight, var titleColorValue: Color = LegendDefaults.titleColor, var labelFontSize: TextUnit = PointLegendDefaults.labelFontSize, var labelColor: Color = PointLegendDefaults.labelColor, var radius: Double = PointLegendDefaults.radius.value.toDouble(), var items: List<PointLegendItem> = emptyList(), var itemResolver: PointLegendFeatureResolver? = null, var layerId: String? = null, var units: MeasurementUnits = MeasurementUnits.IMPERIAL, var margins: Margin = Margin(width = 4.dp.value, height = 4.dp.value)) : Legend

Renders a legend composed of labeled point markers.

Parameters

id

Unique identifier used when registering the legend with a LegendControl.

title

Display title shown above the legend content.

titleColorValue

Color of the legend title.

labelFontSize

Font size for legend item labels.

labelColor

Color of the text labels.

radius

Radius for the circular glyph drawn for each legend item.

items

Static items rendered by the legend when no resolver is provided.

itemResolver

Optional resolver that converts queried features into dynamic legend items.

layerId

Optional layer identifier (or regex) used to scope dynamic legend updates.

units

Units currently applied to any measurement values drawn by the legend.

Constructors

Link copied to clipboard
constructor(id: String, title: String? = null, labelFontWeight: FontWeight = FontWeight.Normal, titleFontSize: TextUnit = LegendDefaults.titleFontSize, titleFontWeight: FontWeight = LegendDefaults.titleFontWeight, titleColorValue: Color = LegendDefaults.titleColor, labelFontSize: TextUnit = PointLegendDefaults.labelFontSize, labelColor: Color = PointLegendDefaults.labelColor, radius: Double = PointLegendDefaults.radius.value.toDouble(), items: List<PointLegendItem> = emptyList(), itemResolver: PointLegendFeatureResolver? = null, layerId: String? = null, units: MeasurementUnits = MeasurementUnits.IMPERIAL, margins: Margin = Margin(width = 4.dp.value, height = 4.dp.value))

Properties

Link copied to clipboard
open override val id: String
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
open override var title: String?
Link copied to clipboard
open override var titleColorValue: Color
Link copied to clipboard
open override var titleFontSize: TextUnit

The size of the Title Text

Link copied to clipboard
Link copied to clipboard
open override var units: MeasurementUnits

Functions

Link copied to clipboard

Returns a new PointLegend with the updated item resolver.

Link copied to clipboard
open override fun items(newItems: List<PointLegendItem>): PointLegend

Returns a new PointLegend with the updated items.

open override fun items(newItems: List<BarLegendItem<Dimension>>): BarLegend<*>
Link copied to clipboard
fun labelColor(newValue: Color): PointLegend

Returns a new PointLegend with the updated label color.

Link copied to clipboard

Returns a new PointLegend with the updated label font size.

Link copied to clipboard
fun layerId(newValue: String?): PointLegend

Returns a new PointLegend with the updated layer ID.

Link copied to clipboard
fun radius(newValue: Double): PointLegend

Returns a new PointLegend with the updated glyph radius.

Link copied to clipboard
open override fun title(newValue: String?): Legend

Allows an implementing class to create a new version of itself with an updated title.

Link copied to clipboard
open fun titleColor(color: Color): Legend
Link copied to clipboard
open override fun units(newValue: MeasurementUnits): Legend

Allows an implementing class to create a new version of itself with updated units.

Link copied to clipboard
open override fun updateFromPaint(paint: LayerPaint): Legend