LocationComponentOptions

This class exposes options for the Location Component. The options can be set by defining a style in your apps style.xml file and passing in directly into the LocationComponent class. Alternatively, if properties need to be changed at runtime depending on a specific state, you can build an instance of this class, setting the values you desire, and then passing it into either the LocationComponent activation method (if it isn't initialized yet) or applyStyle.

When the createFromAttributes methods called, any attributes not found inside the style will revert back to using their default set values. Likewise, when building a new LocationComponentOptions class using the builder, any options neglecting to be set will reset to their default values.

If you would like to keep your custom style changes while modifying a single attribute, you can get the currently used options object using getLocationComponentOptions and it's toBuilder method to modify a single entry while also maintaining the other settings. Once your modifications have been made, you'll need to pass it back into the location component using applyStyle.

Constructors

Link copied to clipboard
constructor(accuracyAlpha: Float, accuracyColor: Int, backgroundDrawableStale: Int, @Nullable backgroundStaleName: String, foregroundDrawableStale: Int, @Nullable foregroundStaleName: String, gpsDrawable: Int, @Nullable gpsName: String, foregroundDrawable: Int, @Nullable foregroundName: String, backgroundDrawable: Int, @Nullable backgroundName: String, bearingDrawable: Int, @Nullable bearingName: String, @Nullable bearingTintColor: Integer, @Nullable foregroundTintColor: Integer, @Nullable backgroundTintColor: Integer, @Nullable foregroundStaleTintColor: Integer, @Nullable backgroundStaleTintColor: Integer, elevation: Float, enableStaleState: Boolean, staleStateTimeout: Long, @Nullable padding: Array<Int>, maxZoomIconScale: Float, minZoomIconScale: Float, trackingGesturesManagement: Boolean, trackingInitialMoveThreshold: Float, trackingMultiFingerMoveThreshold: Float, trackingMultiFingerProtectedMoveArea: RectF, layerAbove: String, layerBelow: String, trackingAnimationDurationMultiplier: Float, compassAnimationEnabled: Boolean, accuracyAnimationEnabled: Boolean, pulseEnabled: Boolean, pulseFadeEnabled: Boolean, pulseColor: Integer, pulseSingleDuration: Float, pulseMaxRadius: Float, pulseAlpha: Float, @Nullable pulseInterpolator: Interpolator)

Types

Link copied to clipboard
open class Builder
Builder class for constructing a new instance of LocationComponentOptions.

Properties

Link copied to clipboard
Default maximum radius of the LocationComponent circle when it's pulsing.
Link copied to clipboard

Functions

Link copied to clipboard
open fun accuracyAlpha(): Float
Set the opacity of the accuracy view to a value from 0 to 1, where 0 means the accuracy view is completely transparent and 1 means the view is completely opaque.
Link copied to clipboard
Enable or disable smooth animation of the accuracy circle around the user's position.
Link copied to clipboard
Solid color to use as the accuracy view color property.
Link copied to clipboard
Defines the drawable used for the background state icon.
Link copied to clipboard
Defines the drawable used for the stale background icon.
Link copied to clipboard
String image name, identical to one used in the first parameter of addImage, the component, will used this image in place of the provided or default maplibre_backgroundDrawable.
Link copied to clipboard
String image name, identical to one used in the first parameter of addImage, the component, will use this image in place of the provided or default maplibre_foregroundDrawableStale.
Link copied to clipboard
Defines the background stale color as an integer.
Link copied to clipboard
Defines the background color as an integer.
Link copied to clipboard
Defines the drawable used for the bearing icon.
Link copied to clipboard
String image name, identical to one used in the first parameter of addImage, the component, will used this image in place of the provided or default maplibre_bearingDrawable.
Link copied to clipboard
Defines the bearing icon color as an integer.
Link copied to clipboard
Build a new instance of the LocationComponentOptions class with all the attributes set automatically to their defined defaults in this library.
Link copied to clipboard
Link copied to clipboard
Construct a new Location Component Options class using the attributes found within a style resource.
Link copied to clipboard
open fun describeContents(): Int
Link copied to clipboard
Sets the base elevation of this view, in pixels.
Link copied to clipboard
Enable or disable to stale state mode.
Link copied to clipboard
open fun equals(o: Any): Boolean
Link copied to clipboard
Supply a Drawable that is to be rendered on top of all of the content in the Location LayerComponent layer stack.
Link copied to clipboard
Defines the drawable used for the stale foreground icon.
Link copied to clipboard
String image name, identical to one used in the first parameter of addImage, the component, will used this image in place of the provided or default maplibre_foregroundDrawable.
Link copied to clipboard
String image name, identical to one used in the first parameter of addImage, the component, will used this image in place of the provided or default maplibre_foregroundDrawableStale.
Link copied to clipboard
Defines the foreground stale color as an integer.
Link copied to clipboard
Defines the foreground color as an integer.
Link copied to clipboard
Defines the drawable used for the navigation state icon.
Link copied to clipboard
open fun gpsName(): String
String image name, identical to one used in the first parameter of addImage, the component, will used this image in place of the provided or default maplibre_gpsDrawable.
Link copied to clipboard
open fun hashCode(): Int
Link copied to clipboard
open fun layerAbove(): String
Gets the id of the layer that's referenced when placing the component on the map using addLayerAbove.
Link copied to clipboard
open fun layerBelow(): String
Gets the id of the layer that's referenced when placing the component on the map using addLayerBelow.
Link copied to clipboard
The scale factor of the location icon when the map is zoomed in.
Link copied to clipboard
The scale factor of the location icon when the map is zoomed out.
Link copied to clipboard
open fun padding(): Array<Int>
Sets the distance from the edges of the map view’s frame to the edges of the map view’s logical viewport.
Link copied to clipboard
open fun pulseAlpha(): Float
The opacity of the LocationComponent's circle as it pulses.
Link copied to clipboard
open fun pulseColor(): Integer
Color of the LocationComponent's pulsing circle as it pulses.
Link copied to clipboard
open fun pulseEnabled(): Boolean
Enable or disable the LocationComponent's pulsing circle.
Link copied to clipboard
Enable or disable fading of the LocationComponent's pulsing circle.
Link copied to clipboard
The interpolator type of animation for the movement of the LocationComponent's circle
Link copied to clipboard
open fun pulseMaxRadius(): Float
The maximum radius that a single pulse should expand the LocationComponent's pulsing circle to.
Link copied to clipboard
The number of milliseconds it takes for a single pulse of the LocationComponent's pulsing circle.
Link copied to clipboard
Set the delay before the location icon becomes stale.
Link copied to clipboard
Takes the currently constructed LocationComponentOptions object and provides it's builder with all the values set matching the values in this instance.
Link copied to clipboard
open fun toString(): String
Link copied to clipboard
Get the tracking animation duration multiplier.
Link copied to clipboard
Returns whether gesture threshold should be adjusted when camera is in one of the tracking modes.
Link copied to clipboard
Minimum single pointer movement in pixels required to break camera tracking.
Link copied to clipboard
Minimum multi pointer movement in pixels required to break camera tracking (for example during scale gesture).
Link copied to clipboard
Protected multi pointer gesture area.
Link copied to clipboard
open fun writeToParcel(dest: Parcel, flags: Int)