Class LocationComponentOptions.Builder
- Enclosing class:
- LocationComponentOptions
LocationComponentOptions.-
Method Summary
Modifier and TypeMethodDescriptionaccuracyAlpha(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.accuracyAnimationEnabled(boolean accuracyAnimationEnabled) Enable or disable smooth animation of the accuracy circle around the user's position.accuracyColor(int accuracyColor) Solid color to use as the accuracy view color property.backgroundDrawable(int backgroundDrawable) Defines the drawable used for the background state icon.backgroundDrawableStale(int backgroundDrawableStale) Defines the drawable used for the stale background icon.backgroundName(String backgroundName) Given a String image name, identical to one used in the first parameter ofStyle.addImage(String, Bitmap), the component, will used this image in place of the provided or default trimblemaps_backgroundDrawable.backgroundStaleName(String backgroundStaleName) Given a String image name, identical to one used in the first parameter ofStyle.addImage(String, Bitmap), the component, will used this image in place of the provided or default trimblemaps_backgroundDrawableStale.backgroundStaleTintColor(Integer backgroundStaleTintColor) Defines the background stale color as an integer.backgroundTintColor(Integer backgroundTintColor) Defines the background color as an integer.bearingDrawable(int bearingDrawable) Defines the drawable used for the bearing icon.bearingName(String bearingName) Given a String image name, identical to one used in the first parameter ofStyle.addImage(String, Bitmap), the component, will used this image in place of the provided or default trimblemaps_bearingDrawable.bearingTintColor(Integer bearingTintColor) Defines the bearing icon color as an integer.build()Build a new instance of thisLocationComponentOptionsclass.compassAnimationEnabled(Boolean compassAnimationEnabled) Enable or disable smooth animation of compass values forCameraModeandRenderMode.elevation(float elevation) Sets the base elevation of this view, in pixels.enableStaleState(boolean enabled) Enable or disable to stale state mode.foregroundDrawable(int foregroundDrawable) Supply a Drawable that is to be rendered on top of all of the content in the Location Component layer stack.foregroundDrawableStale(int foregroundDrawableStale) Defines the drawable used for the stale foreground icon.foregroundName(String foregroundName) Given a String image name, identical to one used in the first parameter ofStyle.addImage(String, Bitmap), the component, will used this image in place of the provided or default trimblemaps_foregroundDrawable.foregroundStaleName(String foregroundStaleName) Given a String image name, identical to one used in the first parameter ofStyle.addImage(String, Bitmap), the component, will used this image in place of the provided or default trimblemaps_foregroundDrawableStale.foregroundStaleTintColor(Integer foregroundStaleTintColor) Defines the foreground stale color as an integer.foregroundTintColor(Integer foregroundTintColor) Defines the foreground color as an integer.gpsDrawable(int gpsDrawable) Defines the drawable used for the navigation state icon.Given a String image name, identical to one used in the first parameter ofStyle.addImage(String, Bitmap), the component, will used this image in place of the provided or default trimblemaps_gpsDrawable.layerAbove(String layerAbove) Sets the id of the layer that's referenced when placing the component on the map usingStyle.addLayerAbove(Layer, String).layerBelow(String layerBelow) Sets the id of the layer that's referenced when placing the component on the map usingStyle.addLayerBelow(Layer, String).maxZoomIconScale(float maxZoomIconScale) Sets the scale factor of the location icon when the map is zoomed in.minZoomIconScale(float minZoomIconScale) Sets the scale factor of the location icon when the map is zoomed out.padding(int[] padding) Deprecated.pulseAlpha(float pulseAlpha) Sets the opacity of the LocationComponent's pulsing circle.pulseColor(int pulseColor) Sets the color of the LocationComponent's pulsing circle.pulseEnabled(boolean pulseEnabled) Enable or disable the LocationComponent's pulsing circle.pulseFadeEnabled(boolean pulseFadeEnabled) Enable or disable fading of the LocationComponent's pulsing circle.pulseInterpolator(android.view.animation.Interpolator pulseInterpolator) Sets the pulsing circle's interpolator animation.pulseMaxRadius(float pulseMaxRadius) The maximum radius that a single pulse should expand the LocationComponent's pulsing circle to.pulseSingleDuration(float pulseSingleDuration) Sets the number of milliseconds it takes for a single pulse of the LocationComponent's pulsing circle.staleStateTimeout(long timeout) Set the timeout before the location icon becomes stale.trackingAnimationDurationMultiplier(float trackingAnimationDurationMultiplier) Sets the tracking animation duration multiplier.trackingGesturesManagement(boolean trackingGesturesManagement) Set whether gesture threshold should be adjusted when camera is in one of the tracking modes.trackingInitialMoveThreshold(float moveThreshold) Sets minimum single pointer movement (map pan) in pixels required to break camera tracking.trackingMultiFingerMoveThreshold(float moveThreshold) Sets minimum multi pointer movement (map pan) in pixels required to break camera tracking (for example during scale gesture).trackingMultiFingerProtectedMoveArea(android.graphics.RectF rect) Sets protected multi pointer gesture area.
-
Method Details
-
build
Build a new instance of thisLocationComponentOptionsclass.- Returns:
- a new instance of
LocationComponentOptions
-
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. References style attribute R.styleable#LocationComponent_accuracyAlpha- Parameters:
accuracyAlpha- the opacity of the accuracy view- Returns:
- this builder for chaining options together
-
accuracyColor
Solid color to use as the accuracy view color property. References style attribute R.styleable#LocationComponent_accuracyColor- Parameters:
accuracyColor- the color of the accuracy view- Returns:
- this builder for chaining options together
-
backgroundDrawableStale
@NonNull public LocationComponentOptions.Builder backgroundDrawableStale(int backgroundDrawableStale) Defines the drawable used for the stale background icon. References style attribute R.styleable#LocationComponent_backgroundDrawableStale- Parameters:
backgroundDrawableStale- the drawable resource ID- Returns:
- this builder for chaining options together
-
backgroundStaleName
@NonNull public LocationComponentOptions.Builder backgroundStaleName(@Nullable String backgroundStaleName) Given a String image name, identical to one used in the first parameter ofStyle.addImage(String, Bitmap), the component, will used this image in place of the provided or default trimblemaps_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.
- Parameters:
backgroundStaleName- String icon or maki-icon name- Returns:
- this builder for chaining options together
-
foregroundDrawableStale
@NonNull public LocationComponentOptions.Builder foregroundDrawableStale(int foregroundDrawableStale) Defines the drawable used for the stale foreground icon. References style attribute R.styleable#LocationComponent_foregroundDrawableStale- Parameters:
foregroundDrawableStale- the drawable resource ID- Returns:
- this builder for chaining options together
-
foregroundStaleName
@NonNull public LocationComponentOptions.Builder foregroundStaleName(@Nullable String foregroundStaleName) Given a String image name, identical to one used in the first parameter ofStyle.addImage(String, Bitmap), the component, will used this image in place of the provided or default trimblemaps_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.
- Parameters:
foregroundStaleName- String icon or maki-icon name- Returns:
- this builder for chaining options together
-
gpsDrawable
Defines the drawable used for the navigation state icon. References style attribute R.styleable#LocationComponent_gpsDrawable- Parameters:
gpsDrawable- the drawable resource ID- Returns:
- this builder for chaining options together
-
gpsName
Given a String image name, identical to one used in the first parameter ofStyle.addImage(String, Bitmap), the component, will used this image in place of the provided or default trimblemaps_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.
- Parameters:
gpsName- String icon or maki-icon name- Returns:
- this builder for chaining options together
-
foregroundDrawable
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- Parameters:
foregroundDrawable- the drawable resource used for the foreground layer- Returns:
- this builder for chaining options together
-
foregroundName
Given a String image name, identical to one used in the first parameter ofStyle.addImage(String, Bitmap), the component, will used this image in place of the provided or default trimblemaps_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.
- Parameters:
foregroundName- String icon or maki-icon name- Returns:
- this builder for chaining options together
-
backgroundDrawable
Defines the drawable used for the background state icon. References style attribute R.styleable#LocationComponent_backgroundDrawable- Parameters:
backgroundDrawable- the drawable resource ID- Returns:
- this builder for chaining options together
-
backgroundName
Given a String image name, identical to one used in the first parameter ofStyle.addImage(String, Bitmap), the component, will used this image in place of the provided or default trimblemaps_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.
- Parameters:
backgroundName- String icon or maki-icon name- Returns:
- this builder for chaining options together
-
bearingDrawable
Defines the drawable used for the bearing icon. References style attribute R.styleable#LocationComponent_bearingDrawable- Parameters:
bearingDrawable- the drawable resource ID- Returns:
- this builder for chaining options together
-
bearingName
Given a String image name, identical to one used in the first parameter ofStyle.addImage(String, Bitmap), the component, will used this image in place of the provided or default trimblemaps_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.
- Parameters:
bearingName- String icon or maki-icon name- Returns:
- this builder for chaining options together
-
bearingTintColor
@NonNull public LocationComponentOptions.Builder bearingTintColor(@Nullable Integer bearingTintColor) Defines the bearing icon color as an integer. References style attribute R.styleable#LocationComponent_bearingTintColor- Parameters:
bearingTintColor- the color integer resource- Returns:
- this builder for chaining options together
-
foregroundTintColor
@NonNull public LocationComponentOptions.Builder foregroundTintColor(@Nullable Integer foregroundTintColor) Defines the foreground color as an integer. References style attribute R.styleable#LocationComponent_foregroundTintColor- Parameters:
foregroundTintColor- the color integer resource- Returns:
- this builder for chaining options together
-
backgroundTintColor
@NonNull public LocationComponentOptions.Builder backgroundTintColor(@Nullable Integer backgroundTintColor) Defines the background color as an integer. References style attribute R.styleable#LocationComponent_backgroundTintColor- Parameters:
backgroundTintColor- the color integer resource- Returns:
- this builder for chaining options together
-
foregroundStaleTintColor
@NonNull public LocationComponentOptions.Builder foregroundStaleTintColor(@Nullable Integer foregroundStaleTintColor) Defines the foreground stale color as an integer. References style attribute R.styleable#LocationComponent_foregroundStaleTintColor- Parameters:
foregroundStaleTintColor- the color integer resource- Returns:
- this builder for chaining options together
-
backgroundStaleTintColor
@NonNull public LocationComponentOptions.Builder backgroundStaleTintColor(@Nullable Integer backgroundStaleTintColor) Defines the background stale color as an integer. References style attribute R.styleable#LocationComponent_backgroundStaleTintColor- Parameters:
backgroundStaleTintColor- the color integer resource- Returns:
- this builder for chaining options together
-
elevation
Sets the base elevation of this view, in pixels. References style attribute R.styleable#LocationComponent_elevation- Parameters:
elevation- the elevation currently set for the location icon- Returns:
- this builder for chaining options together
-
enableStaleState
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- Parameters:
enabled- whether the stale state mode is enabled or not- Returns:
- this builder for chaining options together
-
staleStateTimeout
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- Parameters:
timeout- the duration in milliseconds which it should take before the location is considered stale- Returns:
- this builder for chaining options together
-
padding
Deprecated.UseCameraPosition.Builder.padding(double, double, double, double)orCameraUpdateFactory.paddingTo(double, double, double, double)instead.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.
- Parameters:
padding- The margins for the map in pixels (left, top, right, bottom).
-
maxZoomIconScale
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(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.
- Parameters:
maxZoomIconScale- icon scale factor
-
minZoomIconScale
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(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.
- Parameters:
minZoomIconScale- icon scale factor
-
trackingGesturesManagement
@NonNull public LocationComponentOptions.Builder trackingGesturesManagement(boolean trackingGesturesManagement) 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
AndroidGesturesManagerthat was set withTrimbleMapsMap.setGesturesManager(AndroidGesturesManager, boolean, boolean).- Parameters:
trackingGesturesManagement- true if gestures should be adjusted when in one of the camera tracking modes, false otherwise- See Also:
-
trackingInitialMoveThreshold
Sets minimum single pointer movement (map pan) in pixels required to break camera tracking.- Parameters:
moveThreshold- the minimum movement
-
trackingMultiFingerMoveThreshold
@NonNull public LocationComponentOptions.Builder trackingMultiFingerMoveThreshold(float moveThreshold) Sets minimum multi pointer movement (map pan) in pixels required to break camera tracking (for example during scale gesture).- Parameters:
moveThreshold- the minimum movement
-
trackingMultiFingerProtectedMoveArea
@NonNull public LocationComponentOptions.Builder trackingMultiFingerProtectedMoveArea(@Nullable android.graphics.RectF rect) 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(float)set to 0 or a relatively small value to not interfere with gestures outside of the defined rectangle.- Parameters:
rect- the protected multi finger area while camera is tracking
-
layerAbove
Sets the id of the layer that's referenced when placing the component on the map usingStyle.addLayerAbove(Layer, String).The component is going to placed directly above this layer.
- Parameters:
layerAbove- the id of the layer the component is going to placed directly above.
-
layerBelow
Sets the id of the layer that's referenced when placing the component on the map usingStyle.addLayerBelow(Layer, String).The component is going to placed directly below this layer.
- Parameters:
layerBelow- the id of the layer the component is going to placed directly below.
-
trackingAnimationDurationMultiplier
@NonNull public LocationComponentOptions.Builder trackingAnimationDurationMultiplier(float trackingAnimationDurationMultiplier) Sets the tracking animation duration multiplier.- Parameters:
trackingAnimationDurationMultiplier- the tracking animation duration multiplier
-
compassAnimationEnabled
Enable or disable smooth animation of compass values forCameraModeandRenderMode.- Returns:
- whether smooth compass animation is enabled
-
accuracyAnimationEnabled
Enable or disable smooth animation of the accuracy circle around the user's position.- Returns:
- whether smooth animation of the accuracy circle is enabled
-
pulseEnabled
Enable or disable the LocationComponent's pulsing circle.- Returns:
- whether the LocationComponent's pulsing circle is enabled
-
pulseFadeEnabled
Enable or disable fading of the LocationComponent's pulsing circle. If it fades, the circle's opacity decreases as its radius increases.- Returns:
- whether fading of the LocationComponent's pulsing circle is enabled
-
pulseColor
Sets the color of the LocationComponent's pulsing circle.- Returns:
- the current set color of the circle
-
pulseSingleDuration
Sets the number of milliseconds it takes for a single pulse of the LocationComponent's pulsing circle.- Returns:
- the current set length of time for a single pulse
-
pulseMaxRadius
The maximum radius that a single pulse should expand the LocationComponent's pulsing circle to.- Returns:
- the maximum radius that the pulsing circle will expand to.
-
pulseAlpha
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.- Returns:
- the current opacity of the LocationComponent's pulsing circle
-
pulseInterpolator
public LocationComponentOptions.Builder pulseInterpolator(android.view.animation.Interpolator pulseInterpolator) Sets the pulsing circle's interpolator animation.- Parameters:
pulseInterpolator- the type of Android-system interpolator to use when creating the pulsing animation- Returns:
- a String which represents the interpolator animation that the pulsing circle will use.
-
CameraPosition.Builder.padding(double, double, double, double)orCameraUpdateFactory.paddingTo(double, double, double, double)instead.