Default

open class Default(    units: Set<LengthUnit>,     mantissas: Set<Int> = setOf(1, 2, 5),     lowerBound: Length = 100.centimeters,     upperBound: Length = 50000.kilometers) : ScaleBarMeasure(source)

A scale bar measurement system that generates stops based on given units and m * 10^e.

For example, if the units are Meter, Kilometer and the mantissas are 1, 2, 5, the stops will be: 0.1m, 0.2m, 0.5m, 1m, 2m, 5m, 10m, 20m, 50m, 100m, 200m, 500m, 1km, 2km, 5km, 10km, ...

Parameters

units

the units to generate stops for.

mantissas

the mantissas to generate stops for. Must be single digit positive integers.

Inheritors

Constructors

Link copied to clipboard
constructor(vararg units: LengthUnit)
constructor(    units: Set<LengthUnit>,     mantissas: Set<Int> = setOf(1, 2, 5),     lowerBound: Length = 100.centimeters,     upperBound: Length = 50000.kilometers)

Properties

Link copied to clipboard
open override val stops: List<Length>

List of stops, sorted ascending, at which the scalebar should show. For best results, each stop should be no more than 2.5x times as big as the one before.

Functions

Link copied to clipboard
@Composable
override fun getText(stop: Length): String

Get the formatted text to show for a given stop.