CompassPlugin

Presenter interface for the Compass.

Functions

addCompassClickListener
Link copied to clipboard
abstract fun addCompassClickListener(onClickListener: OnCompassClickListener)

Add an OnClick listener to the presenter.

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(): CompassSettings

Get current compass configuration.

initialize
Link copied to clipboard
open fun initialize()

Called when the plugin is first added to the map.

onCameraMove
Link copied to clipboard
abstract fun onCameraMove(lat: Double, lon: Double, zoom: Double, pitch: Double, bearing: Double, padding: DoubleArray)

Called whenever camera position changes. Could be invoked from any thread when map starts rendering.

onCompassClicked
Link copied to clipboard
abstract fun onCompassClicked()

Invoked when the compass view is clicked.

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.

onStart
Link copied to clipboard
open fun onStart()

Called whenever activity's/fragment's lifecycle is entering a "started" state.

onStop
Link copied to clipboard
open fun onStop()

Called whenever activity's/fragment's lifecycle is entering a "stopped" state.

removeCompassClickListener
Link copied to clipboard
abstract fun removeCompassClickListener(onClickListener: OnCompassClickListener)

Remove an OnClick listener from the presenter.

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

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

Properties

clickable
Link copied to clipboard
abstract var clickable: Boolean

Whether the compass can be clicked and click events can be registered.

enabled
Link copied to clipboard
abstract var enabled: Boolean

Whether the compass is visible on the map.

fadeWhenFacingNorth
Link copied to clipboard
abstract var fadeWhenFacingNorth: Boolean

Whether the compass fades out to invisible when facing north direction.

image
Link copied to clipboard
abstract var image: Drawable?

The compass image, the visual representation of the compass.

marginBottom
Link copied to clipboard
abstract var marginBottom: Float

Defines the margin to the bottom that the compass icon honors.

marginLeft
Link copied to clipboard
abstract var marginLeft: Float

Defines the margin to the left that the compass icon honors.

marginRight
Link copied to clipboard
abstract var marginRight: Float

Defines the margin to the right that the compass icon honors.

marginTop
Link copied to clipboard
abstract var marginTop: Float

Defines the margin to the top that the compass icon honors.

opacity
Link copied to clipboard
abstract var opacity: Float

The alpha channel value of the compass image

position
Link copied to clipboard
abstract var position: Int

Defines where the compass is positioned on the map

rotation
Link copied to clipboard
abstract var rotation: Float

The clockwise rotation value in degrees of the compass.

visibility
Link copied to clipboard
abstract var visibility: Boolean

Whether the compass is displayed.

Inheritors

CompassViewPlugin
Link copied to clipboard