ScaleBarSettings

data class ScaleBarSettings @JvmOverloads() constructor(enabled: Boolean, position: Int, marginLeft: Float, marginTop: Float, marginRight: Float, marginBottom: Float, textColor: Int, primaryColor: Int, secondaryColor: Int, borderWidth: Float, height: Float, textBarMargin: Float, textBorderWidth: Float, textSize: Float, isMetricUnits: Boolean, refreshInterval: Long, showTextBorder: Boolean, ratio: Float, useContinuousRendering: Boolean)

Shows the scale bar on the map.

Constructors

ScaleBarSettings
Link copied to clipboard
fun ScaleBarSettings(enabled: Boolean = true, position: Int = Gravity.TOP or Gravity.START, marginLeft: Float = 4f, marginTop: Float = 4f, marginRight: Float = 4f, marginBottom: Float = 4f, textColor: Int = Color.BLACK, primaryColor: Int = Color.BLACK, secondaryColor: Int = Color.WHITE, borderWidth: Float = 2f, height: Float = 2f, textBarMargin: Float = 8f, textBorderWidth: Float = 2f, textSize: Float = 8f, isMetricUnits: Boolean = true, refreshInterval: Long = 15, showTextBorder: Boolean = true, ratio: Float = 0.5f, useContinuousRendering: Boolean = false)

Properties

borderWidth
Link copied to clipboard
var borderWidth: Float = 2f
Defines width of the border for the scale bar.
enabled
Link copied to clipboard
var enabled: Boolean = true
Whether the scale is visible on the map.
height
Link copied to clipboard
var height: Float = 2f
Defines height of the scale bar.
isMetricUnits
Link copied to clipboard
var isMetricUnits: Boolean = true
Whether the scale bar is using metric unit.
marginBottom
Link copied to clipboard
var marginBottom: Float = 4f
Defines the margin to the bottom that the scale bar honors.
marginLeft
Link copied to clipboard
var marginLeft: Float = 4f
Defines the margin to the left that the scale bar honors.
marginRight
Link copied to clipboard
var marginRight: Float = 4f
Defines the margin to the right that the scale bar honors.
marginTop
Link copied to clipboard
var marginTop: Float = 4f
Defines the margin to the top that the scale bar honors.
position
Link copied to clipboard
var position: Int
Defines where the scale bar is positioned on the map
primaryColor
Link copied to clipboard
var primaryColor: Int
Defines primary color of the scale bar.
ratio
Link copied to clipboard
var ratio: Float = 0.5f
configures ratio of scale bar max width compared with MapView width, default is 0.5.
refreshInterval
Link copied to clipboard
var refreshInterval: Long = 15
Configures minimum refresh interval, in millisecond, default is 15.
secondaryColor
Link copied to clipboard
var secondaryColor: Int
Defines secondary color of the scale bar.
showTextBorder
Link copied to clipboard
var showTextBorder: Boolean = true
Configures whether to show the text border or not, default is true.
textBarMargin
Link copied to clipboard
var textBarMargin: Float = 8f
Defines margin of the text bar of the scale bar.
textBorderWidth
Link copied to clipboard
var textBorderWidth: Float = 2f
Defines text border width of the scale bar.
textColor
Link copied to clipboard
var textColor: Int
Defines text color of the scale bar.
textSize
Link copied to clipboard
var textSize: Float = 8f
Defines text size of the scale bar.
useContinuousRendering
Link copied to clipboard
var useContinuousRendering: Boolean = false
If set to True scale bar will be triggering onDraw depending on ScaleBarSettings.refreshInterval even if actual data did not change.