public abstract class LocationLayerOptions
extends java.lang.Object
implements android.os.Parcelable
LocationLayerPlugin
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 LocationLayerPlugin constructor (if it isn't initialized yet) or
LocationLayerPlugin.applyStyle(LocationLayerOptions).
When the createFromAttributes(Context, int) methods called, any attributes not found
inside the style will revert back to using their default set values. Likewise, when building a
new LocationLayerOptions 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 LocationLayerPlugin.getLocationLayerOptions()
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
layer plugin using LocationLayerPlugin.applyStyle(LocationLayerOptions).
| Modifier and Type | Class and Description |
|---|---|
static class |
LocationLayerOptions.Builder
Builder class for constructing a new instance of
LocationLayerOptions. |
| Constructor and Description |
|---|
LocationLayerOptions() |
| Modifier and Type | Method and Description |
|---|---|
abstract float |
accuracyAlpha()
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.
|
abstract int |
accuracyColor()
Solid color to use as the accuracy view color property.
|
abstract int |
backgroundDrawable()
Defines the drawable used for the background state icon.
|
abstract int |
backgroundDrawableStale()
Defines the drawable used for the stale background icon.
|
abstract java.lang.Integer |
backgroundStaleTintColor()
Defines the background stale color as an integer.
|
abstract java.lang.Integer |
backgroundTintColor()
Defines the background color as an integer.
|
abstract int |
bearingDrawable()
Defines the drawable used for the bearing icon.
|
abstract java.lang.Integer |
bearingTintColor()
Defines the bearing icon color as an integer.
|
static LocationLayerOptions.Builder |
builder(android.content.Context context)
Build a new instance of the
LocationLayerOptions class with all the attributes set
automatically to their defined defaults in this library. |
static LocationLayerOptions |
createFromAttributes(android.content.Context context,
int styleRes)
Construct a new Location Layer Options class using the attributes found within a style
resource.
|
abstract float |
elevation()
Sets the base elevation of this view, in pixels.
|
abstract boolean |
enableStaleState()
Enable or disable to stale state mode.
|
abstract int |
foregroundDrawable()
Supply a Drawable that is to be rendered on top of all of the content in the Location Layer
Plugin layer stack.
|
abstract int |
foregroundDrawableStale()
Defines the drawable used for the stale foreground icon.
|
abstract java.lang.Integer |
foregroundStaleTintColor()
Defines the foreground stale color as an integer.
|
abstract java.lang.Integer |
foregroundTintColor()
Defines the foreground color as an integer.
|
abstract int |
gpsDrawable()
Defines the drawable used for the navigation state icon.
|
abstract double |
maxZoom()
The maximum zoom level the map can be displayed at.
|
abstract double |
minZoom()
The minimum zoom level the map can be displayed at.
|
abstract int[] |
padding()
Sets the distance from the edges of the map view’s frame to the edges of the map
view’s logical viewport.
|
abstract long |
staleStateTimeout()
Set the delay before the location icon becomes stale.
|
abstract LocationLayerOptions.Builder |
toBuilder()
Takes the currently constructed
LocationLayerOptions object and provides it's builder
with all the values set matching the values in this instance. |
abstract float |
trackingInitialMoveThreshold()
Minimum single pointer movement in pixels required to break camera tracking.
|
abstract float |
trackingMultiFingerMoveThreshold()
Minimum multi pointer movement in pixels required to break camera tracking (for example during scale gesture).
|
public static LocationLayerOptions createFromAttributes(@NonNull android.content.Context context, @StyleRes int styleRes)
context - your activity's context used for acquiring resourcesstyleRes - the style id where your custom attributes are definedLocationLayerOptions object with the settings you defined in your style
resourcepublic abstract LocationLayerOptions.Builder toBuilder()
LocationLayerOptions object and provides it's builder
with all the values set matching the values in this instance. This allows you to modify a
single attribute and then rebuild the object.public static LocationLayerOptions.Builder builder(android.content.Context context)
LocationLayerOptions class with all the attributes set
automatically to their defined defaults in this library. This allows you to adjust a few
attributes while leaving the rest alone and maintaining their default behavior.context - your activities context used to acquire the style resourcepublic abstract float accuracyAlpha()
public abstract int accuracyColor()
@DrawableRes public abstract int backgroundDrawableStale()
@DrawableRes public abstract int foregroundDrawableStale()
@DrawableRes public abstract int gpsDrawable()
@DrawableRes public abstract int foregroundDrawable()
@DrawableRes public abstract int backgroundDrawable()
@DrawableRes public abstract int bearingDrawable()
@Nullable public abstract java.lang.Integer bearingTintColor()
@Nullable public abstract java.lang.Integer foregroundTintColor()
@Nullable public abstract java.lang.Integer backgroundTintColor()
@Nullable public abstract java.lang.Integer foregroundStaleTintColor()
@Nullable public abstract java.lang.Integer backgroundStaleTintColor()
@Dimension public abstract float elevation()
public abstract boolean enableStaleState()
public abstract long staleStateTimeout()
public abstract int[] padding()
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.
public abstract double maxZoom()
public abstract double minZoom()
public abstract float trackingInitialMoveThreshold()
public abstract float trackingMultiFingerMoveThreshold()