public static class LocationComponentOptions.Builder extends Object
LocationComponentOptions
.Modifier and Type | Method and Description |
---|---|
LocationComponentOptions.Builder |
accuracyAlpha(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.
|
LocationComponentOptions.Builder |
accuracyAnimationEnabled(Boolean accuracyAnimationEnabled)
Enable or disable smooth animation of the accuracy circle around the user's position.
|
LocationComponentOptions.Builder |
accuracyColor(int accuracyColor)
Solid color to use as the accuracy view color property.
|
LocationComponentOptions.Builder |
backgroundDrawable(int backgroundDrawable)
Defines the drawable used for the background state icon.
|
LocationComponentOptions.Builder |
backgroundDrawableStale(int backgroundDrawableStale)
Defines the drawable used for the stale background icon.
|
LocationComponentOptions.Builder |
backgroundName(String backgroundName)
Given a String image name, identical to one used in
the first parameter of
Style.addImage(String, Bitmap) , the
component, will used this image in place of the provided or default mapbox_backgroundDrawable. |
LocationComponentOptions.Builder |
backgroundStaleName(String backgroundStaleName)
Given a String image name, identical to one used in
the first parameter of
Style.addImage(String, Bitmap) , the
component, will used this image in place of the provided or default mapbox_backgroundDrawableStale. |
LocationComponentOptions.Builder |
backgroundStaleTintColor(Integer backgroundStaleTintColor)
Defines the background stale color as an integer.
|
LocationComponentOptions.Builder |
backgroundTintColor(Integer backgroundTintColor)
Defines the background color as an integer.
|
LocationComponentOptions.Builder |
bearingDrawable(int bearingDrawable)
Defines the drawable used for the bearing icon.
|
LocationComponentOptions.Builder |
bearingName(String bearingName)
Given a String image name, identical to one used in
the first parameter of
Style.addImage(String, Bitmap) , the
component, will used this image in place of the provided or default mapbox_bearingDrawable. |
LocationComponentOptions.Builder |
bearingTintColor(Integer bearingTintColor)
Defines the bearing icon color as an integer.
|
LocationComponentOptions |
build()
Build a new instance of this
LocationComponentOptions class. |
LocationComponentOptions.Builder |
compassAnimationEnabled(Boolean compassAnimationEnabled)
Enable or disable smooth animation of compass values for
CameraMode
and RenderMode . |
LocationComponentOptions.Builder |
elevation(float elevation)
Sets the base elevation of this view, in pixels.
|
LocationComponentOptions.Builder |
enableStaleState(boolean enabled)
Enable or disable to stale state mode.
|
LocationComponentOptions.Builder |
foregroundDrawable(int foregroundDrawable)
Supply a Drawable that is to be rendered on top of all of the content in the Location Component layer stack.
|
LocationComponentOptions.Builder |
foregroundDrawableStale(int foregroundDrawableStale)
Defines the drawable used for the stale foreground icon.
|
LocationComponentOptions.Builder |
foregroundName(String foregroundName)
Given a String image name, identical to one used in
the first parameter of
Style.addImage(String, Bitmap) , the
component, will used this image in place of the provided or default mapbox_foregroundDrawable. |
LocationComponentOptions.Builder |
foregroundStaleName(String foregroundStaleName)
Given a String image name, identical to one used in
the first parameter of
Style.addImage(String, Bitmap) , the
component, will used this image in place of the provided or default mapbox_foregroundDrawableStale. |
LocationComponentOptions.Builder |
foregroundStaleTintColor(Integer foregroundStaleTintColor)
Defines the foreground stale color as an integer.
|
LocationComponentOptions.Builder |
foregroundTintColor(Integer foregroundTintColor)
Defines the foreground color as an integer.
|
LocationComponentOptions.Builder |
gpsDrawable(int gpsDrawable)
Defines the drawable used for the navigation state icon.
|
LocationComponentOptions.Builder |
gpsName(String gpsName)
Given a String image name, identical to one used in
the first parameter of
Style.addImage(String, Bitmap) , the
component, will used this image in place of the provided or default mapbox_gpsDrawable. |
LocationComponentOptions.Builder |
layerAbove(String layerAbove)
Sets the id of the layer that's referenced when placing the component on the map using
Style.addLayerAbove(Layer, String) . |
LocationComponentOptions.Builder |
layerBelow(String layerBelow)
Sets the id of the layer that's referenced when placing the component on the map using
Style.addLayerBelow(Layer, String) . |
LocationComponentOptions.Builder |
maxZoomIconScale(float maxZoomIconScale)
Sets the scale factor of the location icon when the map is zoomed in.
|
LocationComponentOptions.Builder |
minZoomIconScale(float minZoomIconScale)
Sets the scale factor of the location icon when the map is zoomed out.
|
LocationComponentOptions.Builder |
padding(int[] padding)
Sets the distance from the edges of the map view’s frame to the edges of the map
view’s logical viewport.
|
LocationComponentOptions.Builder |
staleStateTimeout(long timeout)
Set the timeout before the location icon becomes stale.
|
LocationComponentOptions.Builder |
trackingAnimationDurationMultiplier(float trackingAnimationDurationMultiplier)
Sets the tracking animation duration multiplier.
|
LocationComponentOptions.Builder |
trackingGesturesManagement(boolean trackingGesturesManagement)
Set whether gesture threshold should be adjusted when camera is in one of the tracking modes.
|
LocationComponentOptions.Builder |
trackingInitialMoveThreshold(float moveThreshold)
Sets minimum single pointer movement (map pan) in pixels required to break camera tracking.
|
LocationComponentOptions.Builder |
trackingMultiFingerMoveThreshold(float moveThreshold)
Sets minimum multi pointer movement (map pan) in pixels required to break camera tracking
(for example during scale gesture).
|
@NonNull public LocationComponentOptions build()
LocationComponentOptions
class.LocationComponentOptions
@NonNull public LocationComponentOptions.Builder accuracyAlpha(float accuracyAlpha)
accuracyAlpha
- the opacity of the accuracy view@NonNull public LocationComponentOptions.Builder accuracyColor(int accuracyColor)
accuracyColor
- the color of the accuracy view@NonNull public LocationComponentOptions.Builder backgroundDrawableStale(int backgroundDrawableStale)
backgroundDrawableStale
- the drawable resource ID@NonNull public LocationComponentOptions.Builder backgroundStaleName(@Nullable String backgroundStaleName)
Style.addImage(String, Bitmap)
, 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.
backgroundStaleName
- String icon or maki-icon name@NonNull public LocationComponentOptions.Builder foregroundDrawableStale(int foregroundDrawableStale)
foregroundDrawableStale
- the drawable resource ID@NonNull public LocationComponentOptions.Builder foregroundStaleName(@Nullable String foregroundStaleName)
Style.addImage(String, Bitmap)
, 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.
foregroundStaleName
- String icon or maki-icon name@NonNull public LocationComponentOptions.Builder gpsDrawable(int gpsDrawable)
gpsDrawable
- the drawable resource ID@NonNull public LocationComponentOptions.Builder gpsName(@Nullable String gpsName)
Style.addImage(String, Bitmap)
, 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.
gpsName
- String icon or maki-icon name@NonNull public LocationComponentOptions.Builder foregroundDrawable(int foregroundDrawable)
foregroundDrawable
- the drawable resource used for the foreground layer@NonNull public LocationComponentOptions.Builder foregroundName(@Nullable String foregroundName)
Style.addImage(String, Bitmap)
, 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.
foregroundName
- String icon or maki-icon name@NonNull public LocationComponentOptions.Builder backgroundDrawable(int backgroundDrawable)
backgroundDrawable
- the drawable resource ID@NonNull public LocationComponentOptions.Builder backgroundName(@Nullable String backgroundName)
Style.addImage(String, Bitmap)
, 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.
backgroundName
- String icon or maki-icon name@NonNull public LocationComponentOptions.Builder bearingDrawable(int bearingDrawable)
bearingDrawable
- the drawable resource ID@NonNull public LocationComponentOptions.Builder bearingName(@Nullable String bearingName)
Style.addImage(String, Bitmap)
, 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.
bearingName
- String icon or maki-icon name@NonNull public LocationComponentOptions.Builder bearingTintColor(@Nullable Integer bearingTintColor)
bearingTintColor
- the color integer resource@NonNull public LocationComponentOptions.Builder foregroundTintColor(@Nullable Integer foregroundTintColor)
foregroundTintColor
- the color integer resource@NonNull public LocationComponentOptions.Builder backgroundTintColor(@Nullable Integer backgroundTintColor)
backgroundTintColor
- the color integer resource@NonNull public LocationComponentOptions.Builder foregroundStaleTintColor(@Nullable Integer foregroundStaleTintColor)
foregroundStaleTintColor
- the color integer resource@NonNull public LocationComponentOptions.Builder backgroundStaleTintColor(@Nullable Integer backgroundStaleTintColor)
backgroundStaleTintColor
- the color integer resource@NonNull public LocationComponentOptions.Builder elevation(float elevation)
elevation
- the elevation currently set for the location icon@NonNull public LocationComponentOptions.Builder enableStaleState(boolean enabled)
enabled
- whether the stale state mode is enabled or not@NonNull public LocationComponentOptions.Builder staleStateTimeout(long timeout)
timeout
- the duration in milliseconds which it should take before the location is
considered stale@NonNull public LocationComponentOptions.Builder padding(@Nullable 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.
padding
- The margins for the map in pixels (left, top, right, bottom).@NonNull public LocationComponentOptions.Builder maxZoomIconScale(float maxZoomIconScale)
Set both this and minZoomIconScale(float)
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.
maxZoomIconScale
- icon scale factor@NonNull public LocationComponentOptions.Builder minZoomIconScale(float minZoomIconScale)
Set both this and maxZoomIconScale(float)
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.
minZoomIconScale
- icon scale factor@NonNull public LocationComponentOptions.Builder trackingGesturesManagement(boolean trackingGesturesManagement)
Note: This can overwrite some of the gesture thresholds
and the custom AndroidGesturesManager
that was set with
MapboxMap.setGesturesManager(AndroidGesturesManager, boolean, boolean)
.
trackingGesturesManagement
- true if gestures should be adjusted when in one of the camera tracking modes,
false otherwisetrackingInitialMoveThreshold(float)
,
trackingMultiFingerMoveThreshold(float)
@NonNull public LocationComponentOptions.Builder trackingInitialMoveThreshold(float moveThreshold)
moveThreshold
- the minimum movement@NonNull public LocationComponentOptions.Builder trackingMultiFingerMoveThreshold(float moveThreshold)
moveThreshold
- the minimum movement@NonNull public LocationComponentOptions.Builder layerAbove(String layerAbove)
Style.addLayerAbove(Layer, String)
.
The component is going to placed directly above this layer.
layerAbove
- the id of the layer the component is going to placed directly above.@NonNull public LocationComponentOptions.Builder layerBelow(String layerBelow)
Style.addLayerBelow(Layer, String)
.
The component is going to placed directly below this layer.
layerBelow
- the id of the layer the component is going to placed directly below.@NonNull public LocationComponentOptions.Builder trackingAnimationDurationMultiplier(float trackingAnimationDurationMultiplier)
trackingAnimationDurationMultiplier
- the tracking animation duration multiplierpublic LocationComponentOptions.Builder compassAnimationEnabled(Boolean compassAnimationEnabled)
CameraMode
and RenderMode
.public LocationComponentOptions.Builder accuracyAnimationEnabled(Boolean accuracyAnimationEnabled)
© 2015–2019 Mapbox. All rights reserved.