ScaleBarPlugin

interface ScaleBarPlugin : ViewPlugin, MapSizePlugin, ScaleBarSettingsInterface

Presenter interface for the ScaleBar.

Functions

bind
Link copied to clipboard
abstract fun bind(mapView: FrameLayout, attrs: AttributeSet?, pixelRatio: Float): View

Bind a view instance

cleanup
Link copied to clipboard
open fun cleanup()

Called when the map is destroyed. Should be used to cleanup plugin resources for that map.

getSettings
Link copied to clipboard
abstract fun getSettings(): ScaleBarSettings

Get current scalebar configuration.

initialize
Link copied to clipboard
open fun initialize()

Called when the plugin is first added to the map.

onDelegateProvider
Link copied to clipboard
open fun onDelegateProvider(delegateProvider: MapDelegateProvider)

Provides all map delegate instances.

onPluginView
Link copied to clipboard
open fun onPluginView(view: View)

Provides a view instances returned in inflate after it's been added to the MapView.

onSizeChanged
Link copied to clipboard
open fun onSizeChanged(width: Int, height: Int)

Invoked when MapView's width and height have changed.

updateSettings
Link copied to clipboard
abstract fun updateSettings(block: ScaleBarSettings.() -> Unit)

Update scalebar configuration, the update will be applied to the plugin automatically.

Properties

borderWidth
Link copied to clipboard
abstract var borderWidth: Float

Defines width of the border for the scale bar.

distancePerPixel
Link copied to clipboard
abstract var distancePerPixel: Float

How many meters in each pixel.

enabled
Link copied to clipboard
abstract var enabled: Boolean

Whether the scale is visible on the map.

height
Link copied to clipboard
abstract var height: Float

Defines height of the scale bar.

isMetricUnits
Link copied to clipboard
abstract var isMetricUnits: Boolean

Whether the scale bar is using metric unit. True if the scale bar is using metric system, false if the scale bar is using imperial units.

marginBottom
Link copied to clipboard
abstract var marginBottom: Float

Defines the margin to the bottom that the scale bar honors.

marginLeft
Link copied to clipboard
abstract var marginLeft: Float

Defines the margin to the left that the scale bar honors.

marginRight
Link copied to clipboard
abstract var marginRight: Float

Defines the margin to the right that the scale bar honors.

marginTop
Link copied to clipboard
abstract var marginTop: Float

Defines the margin to the top that the scale bar honors.

position
Link copied to clipboard
abstract var position: Int

Defines where the scale bar is positioned on the map

primaryColor
Link copied to clipboard
abstract var primaryColor: Int

Defines primary color of the scale bar.

ratio
Link copied to clipboard
abstract var ratio: Float

configures ratio of scale bar max width compared with MapView width, default is 0.5.

refreshInterval
Link copied to clipboard
abstract var refreshInterval: Long

Configures minimum refresh interval, in millisecond, default is 15.

secondaryColor
Link copied to clipboard
abstract var secondaryColor: Int

Defines secondary color of the scale bar.

showTextBorder
Link copied to clipboard
abstract var showTextBorder: Boolean

Configures whether to show the text border or not, default is true.

textBarMargin
Link copied to clipboard
abstract var textBarMargin: Float

Defines margin of the text bar of the scale bar.

textBorderWidth
Link copied to clipboard
abstract var textBorderWidth: Float

Defines text border width of the scale bar.

textColor
Link copied to clipboard
abstract var textColor: Int

Defines text color of the scale bar.

textSize
Link copied to clipboard
abstract var textSize: Float

Defines text size of the scale bar.

useContinuousRendering
Link copied to clipboard
abstract var useContinuousRendering: Boolean

If set to True scale bar will be triggering onDraw depending on ScaleBarSettings.refreshInterval even if actual data did not change. If set to False scale bar will redraw only on demand. Defaults to False and should not be changed explicitly in most cases. Could be set to True to produce correct GPU frame metrics when running gfxinfo command.

Inheritors

ScaleBarPluginImpl
Link copied to clipboard