Class LocationComponentOptions.Builder

java.lang.Object
com.trimblemaps.mapsdk.location.LocationComponentOptions.Builder
Enclosing class:
LocationComponentOptions

public static class LocationComponentOptions.Builder extends Object
Builder class for constructing a new instance of LocationComponentOptions.
  • Method Details

    • build

      @NonNull public LocationComponentOptions build()
      Build a new instance of this LocationComponentOptions class.
      Returns:
      a new instance of LocationComponentOptions
    • accuracyAlpha

      @NonNull public 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. References style attribute R.styleable#LocationComponent_accuracyAlpha
      Parameters:
      accuracyAlpha - the opacity of the accuracy view
      Returns:
      this builder for chaining options together
    • accuracyColor

      @NonNull public LocationComponentOptions.Builder accuracyColor(int 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 of Style.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 of Style.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

      @NonNull public LocationComponentOptions.Builder gpsDrawable(int 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

      @NonNull public LocationComponentOptions.Builder gpsName(@Nullable 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 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

      @NonNull public 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. 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

      @NonNull public LocationComponentOptions.Builder foregroundName(@Nullable 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 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

      @NonNull public LocationComponentOptions.Builder backgroundDrawable(int 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

      @NonNull public LocationComponentOptions.Builder backgroundName(@Nullable 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 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

      @NonNull public LocationComponentOptions.Builder bearingDrawable(int 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

      @NonNull public LocationComponentOptions.Builder bearingName(@Nullable 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 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

      @NonNull public LocationComponentOptions.Builder elevation(float 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

      @NonNull public LocationComponentOptions.Builder enableStaleState(boolean enabled)
      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

      @NonNull public LocationComponentOptions.Builder staleStateTimeout(long timeout)
      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

      @NonNull @Deprecated public LocationComponentOptions.Builder padding(@Nullable int[] padding)
      Deprecated.
      Use CameraPosition.Builder.padding(double, double, double, double) or CameraUpdateFactory.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

      @NonNull public LocationComponentOptions.Builder maxZoomIconScale(float 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

      @NonNull public LocationComponentOptions.Builder minZoomIconScale(float 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 AndroidGesturesManager that was set with TrimbleMapsMap.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

      @NonNull public LocationComponentOptions.Builder trackingInitialMoveThreshold(float moveThreshold)
      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

      @NonNull public 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).

      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

      @NonNull public 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).

      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

      public LocationComponentOptions.Builder compassAnimationEnabled(Boolean compassAnimationEnabled)
      Enable or disable smooth animation of compass values for CameraMode and RenderMode.
      Returns:
      whether smooth compass animation is enabled
    • accuracyAnimationEnabled

      public LocationComponentOptions.Builder accuracyAnimationEnabled(boolean 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

      public LocationComponentOptions.Builder pulseEnabled(boolean pulseEnabled)
      Enable or disable the LocationComponent's pulsing circle.
      Returns:
      whether the LocationComponent's pulsing circle is enabled
    • pulseFadeEnabled

      public LocationComponentOptions.Builder pulseFadeEnabled(boolean 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

      public LocationComponentOptions.Builder pulseColor(@ColorInt int pulseColor)
      Sets the color of the LocationComponent's pulsing circle.
      Returns:
      the current set color of the circle
    • pulseSingleDuration

      public LocationComponentOptions.Builder pulseSingleDuration(float 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

      public LocationComponentOptions.Builder pulseMaxRadius(float 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

      public LocationComponentOptions.Builder pulseAlpha(float 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.