public class LocationComponentOptions
extends java.lang.Object
implements android.os.Parcelable
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
LocationComponent.applyStyle(LocationComponentOptions)
.
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 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 LocationComponent.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 LocationComponent.applyStyle(LocationComponentOptions)
.
Modifier and Type | Class and Description |
---|---|
static class |
LocationComponentOptions.Builder
Builder class for constructing a new instance of
LocationComponentOptions . |
Modifier and Type | Field and Description |
---|---|
static android.os.Parcelable.Creator<LocationComponentOptions> |
CREATOR |
Constructor and Description |
---|
LocationComponentOptions(float accuracyAlpha,
int accuracyColor,
int backgroundDrawableStale,
java.lang.String backgroundStaleName,
int foregroundDrawableStale,
java.lang.String foregroundStaleName,
int gpsDrawable,
java.lang.String gpsName,
int foregroundDrawable,
java.lang.String foregroundName,
int backgroundDrawable,
java.lang.String backgroundName,
int bearingDrawable,
java.lang.String bearingName,
java.lang.Integer bearingTintColor,
java.lang.Integer foregroundTintColor,
java.lang.Integer backgroundTintColor,
java.lang.Integer foregroundStaleTintColor,
java.lang.Integer backgroundStaleTintColor,
float elevation,
boolean enableStaleState,
long staleStateTimeout,
int[] padding,
double maxZoom,
double minZoom,
float maxZoomIconScale,
float minZoomIconScale,
boolean trackingGesturesManagement,
float trackingInitialMoveThreshold,
float trackingMultiFingerMoveThreshold,
java.lang.String layerBelow,
float trackingAnimationDurationMultiplier) |
Modifier and Type | Method and Description |
---|---|
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.
|
int |
accuracyColor()
Solid color to use as the accuracy view color property.
|
int |
backgroundDrawable()
Defines the drawable used for the background state icon.
|
int |
backgroundDrawableStale()
Defines the drawable used for the stale background icon.
|
java.lang.String |
backgroundName()
String image name, identical to one used in
the first parameter of
DingiMap.addImage(String, Bitmap) , the
component, will used this image in place of the provided or default dingi_backgroundDrawable. |
java.lang.String |
backgroundStaleName()
String image name, identical to one used in
the first parameter of
DingiMap.addImage(String, Bitmap) , the
component, will use this image in place of the provided or default dingi_foregroundDrawableStale. |
java.lang.Integer |
backgroundStaleTintColor()
Defines the background stale color as an integer.
|
java.lang.Integer |
backgroundTintColor()
Defines the background color as an integer.
|
int |
bearingDrawable()
Defines the drawable used for the bearing icon.
|
java.lang.String |
bearingName()
String image name, identical to one used in
the first parameter of
DingiMap.addImage(String, Bitmap) , the
component, will used this image in place of the provided or default dingi_bearingDrawable. |
java.lang.Integer |
bearingTintColor()
Defines the bearing icon color as an integer.
|
static LocationComponentOptions.Builder |
builder(android.content.Context context)
Build a new instance of the
LocationComponentOptions class with all the attributes set
automatically to their defined defaults in this library. |
static LocationComponentOptions |
createFromAttributes(android.content.Context context,
int styleRes)
Construct a new Location Component Options class using the attributes found within a style
resource.
|
int |
describeContents() |
float |
elevation()
Sets the base elevation of this view, in pixels.
|
boolean |
enableStaleState()
Enable or disable to stale state mode.
|
boolean |
equals(java.lang.Object o) |
int |
foregroundDrawable()
Supply a Drawable that is to be rendered on top of all of the content in the Location LayerComponent layer stack.
|
int |
foregroundDrawableStale()
Defines the drawable used for the stale foreground icon.
|
java.lang.String |
foregroundName()
String image name, identical to one used in
the first parameter of
DingiMap.addImage(String, Bitmap) , the
component, will used this image in place of the provided or default dingi_foregroundDrawable. |
java.lang.String |
foregroundStaleName()
String image name, identical to one used in
the first parameter of
DingiMap.addImage(String, Bitmap) , the
component, will used this image in place of the provided or default dingi_foregroundDrawableStale. |
java.lang.Integer |
foregroundStaleTintColor()
Defines the foreground stale color as an integer.
|
java.lang.Integer |
foregroundTintColor()
Defines the foreground color as an integer.
|
int |
gpsDrawable()
Defines the drawable used for the navigation state icon.
|
java.lang.String |
gpsName()
String image name, identical to one used in
the first parameter of
DingiMap.addImage(String, Bitmap) , the
component, will used this image in place of the provided or default dingi_gpsDrawable. |
int |
hashCode() |
java.lang.String |
layerBelow()
Gets the id of the layer to add the location component above to.
|
double |
maxZoom()
The maximum zoom level the map can be displayed at.
|
float |
maxZoomIconScale()
The scale factor of the location icon when the map is zoomed in.
|
double |
minZoom()
The minimum zoom level the map can be displayed at.
|
float |
minZoomIconScale()
The scale factor of the location icon when the map is zoomed out.
|
int[] |
padding()
Sets the distance from the edges of the map view’s frame to the edges of the map
view’s logical viewport.
|
long |
staleStateTimeout()
Set the delay before the location icon becomes stale.
|
LocationComponentOptions.Builder |
toBuilder()
Takes the currently constructed
LocationComponentOptions object and provides it's builder
with all the values set matching the values in this instance. |
java.lang.String |
toString() |
float |
trackingAnimationDurationMultiplier()
Get the tracking animation duration multiplier.
|
boolean |
trackingGesturesManagement()
Returns whether gesture threshold should be adjusted when camera is in one of the tracking modes.
|
float |
trackingInitialMoveThreshold()
Minimum single pointer movement in pixels required to break camera tracking.
|
float |
trackingMultiFingerMoveThreshold()
Minimum multi pointer movement in pixels required to break camera tracking (for example during scale gesture).
|
void |
writeToParcel(android.os.Parcel dest,
int flags) |
public static final android.os.Parcelable.Creator<LocationComponentOptions> CREATOR
public LocationComponentOptions(float accuracyAlpha, int accuracyColor, int backgroundDrawableStale, @Nullable java.lang.String backgroundStaleName, int foregroundDrawableStale, @Nullable java.lang.String foregroundStaleName, int gpsDrawable, @Nullable java.lang.String gpsName, int foregroundDrawable, @Nullable java.lang.String foregroundName, int backgroundDrawable, @Nullable java.lang.String backgroundName, int bearingDrawable, @Nullable java.lang.String bearingName, @Nullable java.lang.Integer bearingTintColor, @Nullable java.lang.Integer foregroundTintColor, @Nullable java.lang.Integer backgroundTintColor, @Nullable java.lang.Integer foregroundStaleTintColor, @Nullable java.lang.Integer backgroundStaleTintColor, float elevation, boolean enableStaleState, long staleStateTimeout, @Nullable int[] padding, double maxZoom, double minZoom, float maxZoomIconScale, float minZoomIconScale, boolean trackingGesturesManagement, float trackingInitialMoveThreshold, float trackingMultiFingerMoveThreshold, java.lang.String layerBelow, float trackingAnimationDurationMultiplier)
@Nullable public static LocationComponentOptions 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 definedLocationComponentOptions
object with the settings you defined in your style
resource@NonNull public LocationComponentOptions.Builder toBuilder()
LocationComponentOptions
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.@NonNull public static LocationComponentOptions.Builder builder(@NonNull android.content.Context context)
LocationComponentOptions
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 float accuracyAlpha()
public int accuracyColor()
@DrawableRes public int backgroundDrawableStale()
@Nullable public java.lang.String backgroundStaleName()
DingiMap.addImage(String, Bitmap)
, the
component, will use this image in place of the provided or default dingi_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.
@DrawableRes public int foregroundDrawableStale()
@Nullable public java.lang.String foregroundStaleName()
DingiMap.addImage(String, Bitmap)
, the
component, will used this image in place of the provided or default dingi_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.
@DrawableRes public int gpsDrawable()
@Nullable public java.lang.String gpsName()
DingiMap.addImage(String, Bitmap)
, the
component, will used this image in place of the provided or default dingi_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.
@DrawableRes public int foregroundDrawable()
@Nullable public java.lang.String foregroundName()
DingiMap.addImage(String, Bitmap)
, the
component, will used this image in place of the provided or default dingi_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.
@DrawableRes public int backgroundDrawable()
@Nullable public java.lang.String backgroundName()
DingiMap.addImage(String, Bitmap)
, the
component, will used this image in place of the provided or default dingi_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.
@DrawableRes public int bearingDrawable()
@Nullable public java.lang.String bearingName()
DingiMap.addImage(String, Bitmap)
, the
component, will used this image in place of the provided or default dingi_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.
@Nullable public java.lang.Integer bearingTintColor()
@Nullable public java.lang.Integer foregroundTintColor()
@Nullable public java.lang.Integer backgroundTintColor()
@Nullable public java.lang.Integer foregroundStaleTintColor()
@Nullable public java.lang.Integer backgroundStaleTintColor()
@Dimension public float elevation()
public boolean enableStaleState()
public long staleStateTimeout()
@Nullable public 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 double maxZoom()
public double minZoom()
public float maxZoomIconScale()
maxZoom()
.
Scaling is linear.public float minZoomIconScale()
minZoom()
.
Scaling is linear.public boolean trackingGesturesManagement()
Note: If set to true, this can overwrite some of the gesture thresholds
and the custom AndroidGesturesManager
that was set with
DingiMap.setGesturesManager(AndroidGesturesManager, boolean, boolean)
.
LocationComponentOptions.Builder.trackingInitialMoveThreshold(float)
,
LocationComponentOptions.Builder.trackingMultiFingerMoveThreshold(float)
public float trackingInitialMoveThreshold()
public float trackingMultiFingerMoveThreshold()
public java.lang.String layerBelow()
public float trackingAnimationDurationMultiplier()
@NonNull public java.lang.String toString()
toString
in class java.lang.Object
public boolean equals(java.lang.Object o)
equals
in class java.lang.Object
public int hashCode()
hashCode
in class java.lang.Object
public void writeToParcel(@NonNull android.os.Parcel dest, int flags)
writeToParcel
in interface android.os.Parcelable
public int describeContents()
describeContents
in interface android.os.Parcelable