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 |
layerBelow(String layerBelow)
Sets the layer id to set the location component below to.
|
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).
|
public LocationComponentOptions build()
LocationComponentOptions
class.LocationComponentOptions
public LocationComponentOptions.Builder accuracyAlpha(float accuracyAlpha)
accuracyAlpha
- the opacity of the accuracy viewpublic LocationComponentOptions.Builder accuracyColor(int accuracyColor)
accuracyColor
- the color of the accuracy viewpublic LocationComponentOptions.Builder backgroundDrawableStale(int backgroundDrawableStale)
backgroundDrawableStale
- the drawable resource IDpublic LocationComponentOptions.Builder backgroundStaleName(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 namepublic LocationComponentOptions.Builder foregroundDrawableStale(int foregroundDrawableStale)
foregroundDrawableStale
- the drawable resource IDpublic LocationComponentOptions.Builder foregroundStaleName(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 namepublic LocationComponentOptions.Builder gpsDrawable(int gpsDrawable)
gpsDrawable
- the drawable resource IDpublic LocationComponentOptions.Builder gpsName(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 namepublic LocationComponentOptions.Builder foregroundDrawable(int foregroundDrawable)
foregroundDrawable
- the drawable resource used for the foreground layerpublic LocationComponentOptions.Builder foregroundName(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 namepublic LocationComponentOptions.Builder backgroundDrawable(int backgroundDrawable)
backgroundDrawable
- the drawable resource IDpublic LocationComponentOptions.Builder backgroundName(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 namepublic LocationComponentOptions.Builder bearingDrawable(int bearingDrawable)
bearingDrawable
- the drawable resource IDpublic LocationComponentOptions.Builder bearingName(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 namepublic LocationComponentOptions.Builder bearingTintColor(Integer bearingTintColor)
bearingTintColor
- the color integer resourcepublic LocationComponentOptions.Builder foregroundTintColor(Integer foregroundTintColor)
foregroundTintColor
- the color integer resourcepublic LocationComponentOptions.Builder backgroundTintColor(Integer backgroundTintColor)
backgroundTintColor
- the color integer resourcepublic LocationComponentOptions.Builder foregroundStaleTintColor(Integer foregroundStaleTintColor)
foregroundStaleTintColor
- the color integer resourcepublic LocationComponentOptions.Builder backgroundStaleTintColor(Integer backgroundStaleTintColor)
backgroundStaleTintColor
- the color integer resourcepublic LocationComponentOptions.Builder elevation(float elevation)
elevation
- the elevation currently set for the location iconpublic LocationComponentOptions.Builder enableStaleState(boolean enabled)
enabled
- whether the stale state mode is enabled or notpublic LocationComponentOptions.Builder staleStateTimeout(long timeout)
timeout
- the duration in milliseconds which it should take before the location is
considered stalepublic LocationComponentOptions.Builder padding(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).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 factorpublic 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 factorpublic LocationComponentOptions.Builder trackingGesturesManagement(boolean trackingGesturesManagement)
Note: This can overwrite some of the gesture thresholds
and the custom com.mapbox.android.gestures.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)
public LocationComponentOptions.Builder trackingInitialMoveThreshold(float moveThreshold)
moveThreshold
- the minimum movementpublic LocationComponentOptions.Builder trackingMultiFingerMoveThreshold(float moveThreshold)
moveThreshold
- the minimum movementpublic LocationComponentOptions.Builder layerBelow(String layerBelow)
layerBelow
- the id to set the location component below to.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–2018 Mapbox. All rights reserved.