Builder

Builder class for constructing a new instance of LocationComponentOptions .

open class Builder

Constructors

Builder
Link copied to clipboard
open fun Builder()

Functions

accuracyAlpha
Link copied to clipboard

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. References style attribute R.styleable#LocationComponent_accuracyAlpha

open fun accuracyAlpha(accuracyAlpha: Float): LocationComponentOptions.Builder
accuracyAnimationEnabled
Link copied to clipboard

Enable or disable smooth animation of the accuracy circle around the user's position.

open fun accuracyAnimationEnabled(accuracyAnimationEnabled: Boolean): LocationComponentOptions.Builder
accuracyColor
Link copied to clipboard

Solid color to use as the accuracy view color property. References style attribute R.styleable#LocationComponent_accuracyColor

open fun accuracyColor(accuracyColor: Int): LocationComponentOptions.Builder
autoBuild
Link copied to clipboard
open fun autoBuild(): LocationComponentOptions
backgroundDrawable
Link copied to clipboard

Defines the drawable used for the background state icon. References style attribute R.styleable#LocationComponent_backgroundDrawable

open fun backgroundDrawable(backgroundDrawable: Int): LocationComponentOptions.Builder
backgroundDrawableStale
Link copied to clipboard

Defines the drawable used for the stale background icon. References style attribute R.styleable#LocationComponent_backgroundDrawableStale

open fun backgroundDrawableStale(backgroundDrawableStale: Int): LocationComponentOptions.Builder
backgroundName
Link copied to clipboard

Given a String image name, identical to one used in the first parameter of , the component, will used this image in place of the provided or default mapbox_backgroundDrawable.

A maki-icon name (example: "circle-15") may also be provided. These are images that can be loaded with certain styles. Note, this will fail if the provided icon name is not provided by the loaded map style.

open fun backgroundName(backgroundName: String): LocationComponentOptions.Builder
backgroundStaleName
Link copied to clipboard

Given a String image name, identical to one used in the first parameter of , the component, will used this image in place of the provided or default mapbox_backgroundDrawableStale.

A maki-icon name (example: "circle-15") may also be provided. These are images that can be loaded with certain styles. Note, this will fail if the provided icon name is not provided by the loaded map style.

open fun backgroundStaleName(backgroundStaleName: String): LocationComponentOptions.Builder
backgroundStaleTintColor
Link copied to clipboard

Defines the background stale color as an integer. References style attribute R.styleable#LocationComponent_backgroundStaleTintColor

open fun backgroundStaleTintColor(backgroundStaleTintColor: Integer): LocationComponentOptions.Builder
backgroundTintColor
Link copied to clipboard

Defines the background color as an integer. References style attribute R.styleable#LocationComponent_backgroundTintColor

open fun backgroundTintColor(backgroundTintColor: Integer): LocationComponentOptions.Builder
bearingDrawable
Link copied to clipboard

Defines the drawable used for the bearing icon. References style attribute R.styleable#LocationComponent_bearingDrawable

open fun bearingDrawable(bearingDrawable: Int): LocationComponentOptions.Builder
bearingName
Link copied to clipboard

Given a String image name, identical to one used in the first parameter of , the component, will used this image in place of the provided or default mapbox_bearingDrawable.

A maki-icon name (example: "circle-15") may also be provided. These are images that can be loaded with certain styles. Note, this will fail if the provided icon name is not provided by the loaded map style.

open fun bearingName(bearingName: String): LocationComponentOptions.Builder
bearingTintColor
Link copied to clipboard

Defines the bearing icon color as an integer. References style attribute R.styleable#LocationComponent_bearingTintColor

open fun bearingTintColor(bearingTintColor: Integer): LocationComponentOptions.Builder
build
Link copied to clipboard

Build a new instance of this LocationComponentOptions class.

open fun build(): LocationComponentOptions
compassAnimationEnabled
Link copied to clipboard

Enable or disable smooth animation of compass values for com.mapbox.maps.plugin.location.modes.CameraMode and com.mapbox.maps.plugin.location.modes.RenderMode .

open fun compassAnimationEnabled(compassAnimationEnabled: Boolean): LocationComponentOptions.Builder
elevation
Link copied to clipboard

Sets the base elevation of this view, in pixels. References style attribute R.styleable#LocationComponent_elevation

open fun elevation(elevation: Float): LocationComponentOptions.Builder
enableStaleState
Link copied to clipboard

Enable or disable to stale state mode. This mode indicates to the user that the location being displayed on the map hasn't been updated in a specific amount of time. References style attribute R.styleable#LocationComponent_enableStaleState

open fun enableStaleState(enabled: Boolean): LocationComponentOptions.Builder
foregroundDrawable
Link copied to clipboard

Supply a Drawable that is to be rendered on top of all of the content in the Location Component layer stack. References style attribute R.styleable#LocationComponent_foregroundDrawable

open fun foregroundDrawable(foregroundDrawable: Int): LocationComponentOptions.Builder
foregroundDrawableStale
Link copied to clipboard

Defines the drawable used for the stale foreground icon. References style attribute R.styleable#LocationComponent_foregroundDrawableStale

open fun foregroundDrawableStale(foregroundDrawableStale: Int): LocationComponentOptions.Builder
foregroundName
Link copied to clipboard

Given a String image name, identical to one used in the first parameter of , the component, will used this image in place of the provided or default mapbox_foregroundDrawable.

A maki-icon name (example: "circle-15") may also be provided. These are images that can be loaded with certain styles. Note, this will fail if the provided icon name is not provided by the loaded map style.

open fun foregroundName(foregroundName: String): LocationComponentOptions.Builder
foregroundStaleName
Link copied to clipboard

Given a String image name, identical to one used in the first parameter of , the component, will used this image in place of the provided or default mapbox_foregroundDrawableStale.

A maki-icon name (example: "circle-15") may also be provided. These are images that can be loaded with certain styles. Note, this will fail if the provided icon name is not provided by the loaded map style.

open fun foregroundStaleName(foregroundStaleName: String): LocationComponentOptions.Builder
foregroundStaleTintColor
Link copied to clipboard

Defines the foreground stale color as an integer. References style attribute R.styleable#LocationComponent_foregroundStaleTintColor

open fun foregroundStaleTintColor(foregroundStaleTintColor: Integer): LocationComponentOptions.Builder
foregroundTintColor
Link copied to clipboard

Defines the foreground color as an integer. References style attribute R.styleable#LocationComponent_foregroundTintColor

open fun foregroundTintColor(foregroundTintColor: Integer): LocationComponentOptions.Builder
gpsDrawable
Link copied to clipboard

Defines the drawable used for the navigation state icon. References style attribute R.styleable#LocationComponent_gpsDrawable

open fun gpsDrawable(gpsDrawable: Int): LocationComponentOptions.Builder
gpsName
Link copied to clipboard

Given a String image name, identical to one used in the first parameter of , the component, will used this image in place of the provided or default mapbox_gpsDrawable.

A maki-icon name (example: "circle-15") may also be provided. These are images that can be loaded with certain styles. Note, this will fail if the provided icon name is not provided by the loaded map style.

open fun gpsName(gpsName: String): LocationComponentOptions.Builder
layerAbove
Link copied to clipboard

Sets the id of the layer that's referenced when placing the component on the map using .

The component is going to placed directly above this layer.

open fun layerAbove(layerAbove: String): LocationComponentOptions.Builder
layerBelow
Link copied to clipboard

Sets the id of the layer that's referenced when placing the component on the map using .

The component is going to placed directly below this layer.

open fun layerBelow(layerBelow: String): LocationComponentOptions.Builder
maxZoomIconScale
Link copied to clipboard

Sets the scale factor of the location icon when the map is zoomed in. Scaling is linear and the new pixel size of the image will be the original pixel size multiplied by the argument.

Set both this and minZoomIconScale to 1f to disable location icon scaling.

Scaling is based on the maps minimum and maximum zoom levels in time of component's style application.

open fun maxZoomIconScale(maxZoomIconScale: Float): LocationComponentOptions.Builder
minZoomIconScale
Link copied to clipboard

Sets the scale factor of the location icon when the map is zoomed out. Scaling is linear and the new pixel size of the image will be the original pixel size multiplied by the argument.

Set both this and maxZoomIconScale to 1f to disable location icon scaling.

Scaling is based on the maps minimum and maximum zoom levels in time of component's style application.

open fun minZoomIconScale(minZoomIconScale: Float): LocationComponentOptions.Builder
padding
Link copied to clipboard

Sets the distance from the edges of the map view’s frame to the edges of the map view’s logical viewport.

When the value of this property is equal to { 0,0,0,0 } , viewport properties such as `centerCoordinate` assume a viewport that matches the map view’s frame. Otherwise, those properties are inset, excluding part of the frame from the viewport. For instance, if the only the top edge is inset, the map center is effectively shifted downward.

open fun padding(padding: Array<Int>): LocationComponentOptions.Builder
pulseAlpha
Link copied to clipboard

Sets the opacity of the LocationComponent's pulsing circle. The expected range is 0 to 1. An opacity of 1 makes the layer fully visible.

open fun pulseAlpha(pulseAlpha: Float): LocationComponentOptions.Builder
pulseColor
Link copied to clipboard

Sets the color of the LocationComponent's pulsing circle.

open fun pulseColor(pulseColor: Int): LocationComponentOptions.Builder
pulseEnabled
Link copied to clipboard

Enable or disable the LocationComponent's pulsing circle.

open fun pulseEnabled(pulseEnabled: Boolean): LocationComponentOptions.Builder
pulseFadeEnabled
Link copied to clipboard

Enable or disable fading of the LocationComponent's pulsing circle. If it fades, the circle's opacity decreases as its radius increases.

open fun pulseFadeEnabled(pulseFadeEnabled: Boolean): LocationComponentOptions.Builder
pulseInterpolator
Link copied to clipboard

Sets the pulsing circle's interpolator animation.

open fun pulseInterpolator(pulseInterpolator: Interpolator): LocationComponentOptions.Builder
pulseMaxRadius
Link copied to clipboard

The maximum radius that a single pulse should expand the LocationComponent's pulsing circle to.

open fun pulseMaxRadius(pulseMaxRadius: Float): LocationComponentOptions.Builder
pulseSingleDuration
Link copied to clipboard

Sets the number of milliseconds it takes for a single pulse of the LocationComponent's pulsing circle.

open fun pulseSingleDuration(pulseSingleDuration: Float): LocationComponentOptions.Builder
staleStateTimeout
Link copied to clipboard

Set the timeout before the location icon becomes stale. The timer begins approximately when a new location update comes in and using this defined time, if an update hasn't occurred by the end, the location is considered stale. References style attribute R.styleable#LocationComponent_staleStateTimeout

open fun staleStateTimeout(timeout: Long): LocationComponentOptions.Builder
trackingAnimationDurationMultiplier
Link copied to clipboard

Sets the tracking animation duration multiplier.

open fun trackingAnimationDurationMultiplier(trackingAnimationDurationMultiplier: Float): LocationComponentOptions.Builder
trackingGesturesManagement
Link copied to clipboard

Set whether gesture threshold should be adjusted when camera is in one of the tracking modes. This will adjust the focal point and increase thresholds to enable camera manipulation, like zooming in and out, without breaking tracking.

Note: This can overwrite some of the gesture thresholds and the custom com.mapbox.android.gestures.AndroidGesturesManager that was set with .

open fun trackingGesturesManagement(trackingGesturesManagement: Boolean): LocationComponentOptions.Builder
trackingInitialMoveThreshold
Link copied to clipboard

Sets minimum single pointer movement (map pan) in pixels required to break camera tracking.

open fun trackingInitialMoveThreshold(moveThreshold: Float): LocationComponentOptions.Builder
trackingMultiFingerMoveThreshold
Link copied to clipboard

Sets minimum multi pointer movement (map pan) in pixels required to break camera tracking (for example during scale gesture).

open fun trackingMultiFingerMoveThreshold(moveThreshold: Float): LocationComponentOptions.Builder
trackingMultiFingerProtectedMoveArea
Link copied to clipboard

Sets protected multi pointer gesture area. When the camera is in a tracking mode,any multi finger gesture with focal point inside the provided screen coordinate rectangle is not going to break the tracking.

Best paired with the trackingMultiFingerMoveThreshold set to 0 or a relatively small value to not interfere with gestures outside of the defined rectangle.