sdk-maps-ui-extensions / com.tomtom.online.sdk.map.ui.compass / BasicCompassView

BasicCompassView

open class BasicCompassView : AppCompatImageView, CompassView, OnClickListener

Button that represents 2D compass. When clicked, the map is set to north up. The button is visible only when map is not set to north up. Fade in / out animation is used to change button visibility.

Constructors

<init>

BasicCompassView(context: Context!)

Default constructor that uses context to initialize this view by loading image resource and setting up on click listener.

BasicCompassView(context: Context!, attrs: AttributeSet!)

Custom constructor that uses context to initialize this view by loading image resource and setting up on click listener. This constructor should be used to provide custom set of attributes.

BasicCompassView(context: Context!, attrs: AttributeSet!, defStyleAttr: Int)

Custom constructor that uses context to initialize this view by loading image resource and setting up on click listener. This constructor should be used to provide custom set of attributes and a reference to default style resource.

Functions

getView

open fun getView(): ImageView

hide

open fun hide(): Unit

onClick

open fun onClick(view: View!): Unit

onRestoreInstanceState

open fun onRestoreInstanceState(state: Parcelable!): Unit

onSaveInstanceState

open fun onSaveInstanceState(): Parcelable?

rotate

open fun rotate(yawDegrees: Float): Unit

setMargins

open fun setMargins(left: Int, top: Int, right: Int, bottom: Int): Unit

setOnMapComponentClickCallback

open fun setOnMapComponentClickCallback(callback: MapComponentClickCallback!): Unit

show

open fun show(): Unit

startNorthUpAnimationIfApplicable

open fun startNorthUpAnimationIfApplicable(): Unit

Starts the animation if the compass has been rotated to point on North. In other cases this method will not have effect. It can be overridden to disable the