Class TrimbleMapsMapOptions

java.lang.Object
com.trimblemaps.mapsdk.maps.TrimbleMapsMapOptions
All Implemented Interfaces:
android.os.Parcelable

public class TrimbleMapsMapOptions extends Object implements android.os.Parcelable
Defines configuration TrimbleMapsMapOptions for a TrimbleMapsMap. These options can be used when adding a map to your application programmatically (as opposed to via XML). If you are using a MapFragment, you can pass these options in using the static factory method newInstance(TrimbleMapsMapOptions). If you are using a MapView, you can pass these options in using the constructor MapView(Context, TrimbleMapsMapOptions). If you add a map using XML, then you can apply these options using custom XML tags.
  • Field Details

  • Constructor Details

  • Method Details

    • createFromAttributes

      @NonNull public static TrimbleMapsMapOptions createFromAttributes(@NonNull android.content.Context context)
      Creates a default TrimbleMapsMapsOptions from a given context.
      Parameters:
      context - Context related to a map view.
      Returns:
      the TrimbleMapsMapOptions created from attributes
    • createFromAttributes

      @NonNull public static TrimbleMapsMapOptions createFromAttributes(@NonNull android.content.Context context, @Nullable android.util.AttributeSet attrs)
      Creates a TrimbleMapsMapsOptions from the attribute set.
      Parameters:
      context - Context related to a map view.
      attrs - Attributeset containing configuration
      Returns:
      the TrimbleMapsMapOptions created from attributes
    • apiBaseUrl

      @Deprecated @NonNull public TrimbleMapsMapOptions apiBaseUrl(String apiBaseUrl)
      Deprecated.
      use apiBaseUri instead
      Specifies the URL used for API endpoint.
      Parameters:
      apiBaseUrl - The base of our API endpoint
      Returns:
      This
    • apiBaseUri

      @NonNull public TrimbleMapsMapOptions apiBaseUri(String apiBaseUri)
      Specifies the URI used for API endpoint.
      Parameters:
      apiBaseUri - The base of our API endpoint
      Returns:
      This
    • camera

      @NonNull public TrimbleMapsMapOptions camera(com.trimblemaps.mapsdk.camera.CameraPosition cameraPosition)
      Specifies a the initial camera position for the map view.
      Parameters:
      cameraPosition - Inital camera position
      Returns:
      This
    • debugActive

      @NonNull public TrimbleMapsMapOptions debugActive(boolean enabled)
      Specifies the used debug type for a map view.
      Parameters:
      enabled - True is debug is enabled
      Returns:
      This
    • minZoomPreference

      @NonNull public TrimbleMapsMapOptions minZoomPreference(double minZoom)
      Specifies the used minimum zoom level for a map view.
      Parameters:
      minZoom - Zoom level to be used
      Returns:
      This
    • maxZoomPreference

      @NonNull public TrimbleMapsMapOptions maxZoomPreference(double maxZoom)
      Specifies the used maximum zoom level for a map view.
      Parameters:
      maxZoom - Zoom level to be used
      Returns:
      This
    • minPitchPreference

      @NonNull public TrimbleMapsMapOptions minPitchPreference(double minPitch)
      Specifies the used minimum pitch for a map view.
      Parameters:
      minPitch - Pitch to be used
      Returns:
      This
    • maxPitchPreference

      @NonNull public TrimbleMapsMapOptions maxPitchPreference(double maxPitch)
      Specifies the used maximum pitch for a map view.
      Parameters:
      maxPitch - Pitch to be used
      Returns:
      This
    • compassEnabled

      @NonNull public TrimbleMapsMapOptions compassEnabled(boolean enabled)
      Specifies the visibility state of a trimblemaps_compass_icon for a map view.
      Parameters:
      enabled - True and trimblemaps_compass_icon is shown
      Returns:
      This
    • compassGravity

      @NonNull public TrimbleMapsMapOptions compassGravity(int gravity)
      Specifies the gravity state of trimblemaps_compass_icon for a map view.
      Parameters:
      gravity - Android SDK Gravity.
      Returns:
      This
    • compassMargins

      @NonNull public TrimbleMapsMapOptions compassMargins(int[] margins)
      Specifies the margin state of trimblemaps_compass_icon for a map view
      Parameters:
      margins - 4 long array for LTRB margins
      Returns:
      This
    • compassFadesWhenFacingNorth

      @NonNull public TrimbleMapsMapOptions compassFadesWhenFacingNorth(boolean compassFadeWhenFacingNorth)
      Specifies if the trimblemaps_compass_icon fades to invisible when facing north.

      By default this value is true.

      Parameters:
      compassFadeWhenFacingNorth - true is trimblemaps_compass_icon fades to invisble
      Returns:
      This
    • compassImage

      @NonNull public TrimbleMapsMapOptions compassImage(android.graphics.drawable.Drawable compass)
      Specifies the image of the CompassView.

      By default this value is R.drawable.trimblemaps_compass_icon.

      Parameters:
      compass - the drawable to show as image compass
      Returns:
      This
    • logoEnabled

      @NonNull public TrimbleMapsMapOptions logoEnabled(boolean enabled)
      Specifies the visibility state of a logo for a map view.
      Parameters:
      enabled - True and logo is shown
      Returns:
      This
    • logoGravity

      @NonNull public TrimbleMapsMapOptions logoGravity(int gravity)
      Specifies the gravity state of logo for a map view.
      Parameters:
      gravity - Android SDK Gravity.
      Returns:
      This
    • logoMargins

      @NonNull public TrimbleMapsMapOptions logoMargins(int[] margins)
      Specifies the margin state of logo for a map view
      Parameters:
      margins - 4 long array for LTRB margins
      Returns:
      This
    • attributionEnabled

      @NonNull public TrimbleMapsMapOptions attributionEnabled(boolean enabled)
      Specifies the visibility state of a attribution for a map view.
      Parameters:
      enabled - True and attribution is shown
      Returns:
      This
    • attributionGravity

      @NonNull public TrimbleMapsMapOptions attributionGravity(int gravity)
      Specifies the gravity state of attribution for a map view.
      Parameters:
      gravity - Android SDK Gravity.
      Returns:
      This
    • attributionMargins

      @NonNull public TrimbleMapsMapOptions attributionMargins(int[] margins)
      Specifies the margin state of attribution for a map view
      Parameters:
      margins - 4 long array for LTRB margins
      Returns:
      This
    • attributionTintColor

      @NonNull public TrimbleMapsMapOptions attributionTintColor(@ColorInt int color)
      Specifies the tint color of the attribution for a map view
      Parameters:
      color - integer resembling a color
      Returns:
      This
    • rotateGesturesEnabled

      @NonNull public TrimbleMapsMapOptions rotateGesturesEnabled(boolean enabled)
      Specifies if the rotate gesture is enabled for a map view.
      Parameters:
      enabled - True and gesture will be enabled
      Returns:
      This
    • scrollGesturesEnabled

      @NonNull public TrimbleMapsMapOptions scrollGesturesEnabled(boolean enabled)
      Specifies if the scroll gesture is enabled for a map view.
      Parameters:
      enabled - True and gesture will be enabled
      Returns:
      This
    • horizontalScrollGesturesEnabled

      @NonNull public TrimbleMapsMapOptions horizontalScrollGesturesEnabled(boolean enabled)
      Specifies if the horizontal scroll gesture is enabled for a map view.
      Parameters:
      enabled - True and gesture will be enabled
      Returns:
      This
    • tiltGesturesEnabled

      @NonNull public TrimbleMapsMapOptions tiltGesturesEnabled(boolean enabled)
      Specifies if the tilt gesture is enabled for a map view.
      Parameters:
      enabled - True and gesture will be enabled
      Returns:
      This
    • zoomGesturesEnabled

      @NonNull public TrimbleMapsMapOptions zoomGesturesEnabled(boolean enabled)
      Specifies if the zoom gesture is enabled for a map view.
      Parameters:
      enabled - True and gesture will be enabled
      Returns:
      This
    • doubleTapGesturesEnabled

      @NonNull public TrimbleMapsMapOptions doubleTapGesturesEnabled(boolean enabled)
      Specifies if the double tap gesture is enabled for a map view.
      Parameters:
      enabled - True and gesture will be enabled
      Returns:
      This
    • quickZoomGesturesEnabled

      @NonNull public TrimbleMapsMapOptions quickZoomGesturesEnabled(boolean enabled)
      Specifies whether the user may zoom the map by tapping twice, holding and moving the pointer up and down.
      Parameters:
      enabled - True and gesture will be enabled
      Returns:
      This
    • textureMode

      @NonNull public TrimbleMapsMapOptions textureMode(boolean textureMode)
      Enable TextureView as rendered surface.

      Since the 5.2.0 release we replaced our TextureView with an GLSurfaceView implementation. Enabling this option will use the TextureView instead. TextureView can be useful in situations where you need to animate, scale or transform the view. This comes at a siginficant performance penalty and should not be considered unless absolutely needed.

      Parameters:
      textureMode - True to enable texture mode
      Returns:
      This
    • translucentTextureSurface

      @NonNull public TrimbleMapsMapOptions translucentTextureSurface(boolean translucentTextureSurface)
    • foregroundLoadColor

      @NonNull public TrimbleMapsMapOptions foregroundLoadColor(@ColorInt int loadColor)
      Set the MapView foreground color that is used when the map surface is being created.
      Parameters:
      loadColor - the color to show during map creation
      Returns:
      This
    • setPrefetchesTiles

      @Deprecated @NonNull public TrimbleMapsMapOptions setPrefetchesTiles(boolean enable)
      Deprecated.
      Enable tile pre-fetching. Loads tiles at a lower zoom-level to pre-render a low resolution preview while more detailed tiles are loaded. Enabled by default
      Parameters:
      enable - true to enable
      Returns:
      This
    • setPrefetchZoomDelta

      @NonNull public TrimbleMapsMapOptions setPrefetchZoomDelta(@IntRange(from=0L) int delta)
      Set the tile pre-fetching zoom delta. Pre-fetching makes sure that a low-resolution tile at the (current_zoom_level - delta) is rendered as soon as possible at the expense of a little bandwidth. Note: This operation will override the TrimbleMapsMapOptions#setPrefetchesTiles(boolean) Setting zoom delta to 0 will disable pre-fetching. Default zoom delta is 4.
      Parameters:
      delta - zoom delta
      Returns:
      This
    • crossSourceCollisions

      @NonNull public TrimbleMapsMapOptions crossSourceCollisions(boolean crossSourceCollisions)
      Enable cross-source symbol collision detection, defaults to true.

      If set to false, symbol layers will only run collision detection against other symbol layers that are part of the same source.

      Parameters:
      crossSourceCollisions - true to enable, false to disable
      Returns:
      This
    • localIdeographFontFamilyEnabled

      @NonNull public TrimbleMapsMapOptions localIdeographFontFamilyEnabled(boolean enabled)
      Enable local ideograph font family, defaults to true.
      Parameters:
      enabled - true to enable, false to disable
      Returns:
      This
    • localIdeographFontFamily

      @NonNull public TrimbleMapsMapOptions localIdeographFontFamily(String fontFamily)
      Set the font family for generating glyphs locally for ideographs in the 'CJK Unified Ideographs' and 'Hangul Syllables' ranges.

      The font family argument is passed to Typeface.create(String, int). Default system fonts are defined in '/system/etc/fonts.xml' Default font for local ideograph font family is TrimbleMapsConstants.DEFAULT_FONT.

      Parameters:
      fontFamily - font family for local ideograph generation.
      Returns:
      This
    • localIdeographFontFamily

      @NonNull public TrimbleMapsMapOptions localIdeographFontFamily(String... fontFamilies)
      Set a font family from range of font families for generating glyphs locally for ideographs in the 'CJK Unified Ideographs' and 'Hangul Syllables' ranges. The first matching font will be selected. If no valid font found, it defaults to TrimbleMapsConstants.DEFAULT_FONT.

      The font families are checked against the default system fonts defined in '/system/etc/fonts.xml' Default font for local ideograph font family is TrimbleMapsConstants.DEFAULT_FONT.

      Parameters:
      fontFamilies - an array of font families for local ideograph generation.
      Returns:
      This
    • pixelRatio

      @NonNull public TrimbleMapsMapOptions pixelRatio(float pixelRatio)
      Set the custom pixel ratio configuration to override the default value from resources. This ratio will be used to initialise the map with.
      Parameters:
      pixelRatio - the custom pixel ratio of the map under construction
      Returns:
      This
    • getPrefetchesTiles

      @Deprecated public boolean getPrefetchesTiles()
      Deprecated.
      Check whether tile pre-fetching is enabled.
      Returns:
      true if enabled
    • getPrefetchZoomDelta

      @IntRange(from=0L) public int getPrefetchZoomDelta()
      Check current pre-fetching zoom delta.
      Returns:
      current zoom delta.
    • getCrossSourceCollisions

      public boolean getCrossSourceCollisions()
      Check whether cross-source symbol collision detection is enabled.
      Returns:
      true if enabled
    • renderSurfaceOnTop

      public void renderSurfaceOnTop(boolean renderOnTop)
      Set the flag to render the map surface on top of another surface.
      Parameters:
      renderOnTop - true if this map is shown on top of another one, false if bottom.
    • getRenderSurfaceOnTop

      public boolean getRenderSurfaceOnTop()
      Get the flag to render the map surface on top of another surface.
      Returns:
      true if this map is
    • getApiBaseUrl

      @Deprecated public String getApiBaseUrl()
      Deprecated.
      use getApiBaseUri() instead
      Get the current configured API endpoint base URL.
      Returns:
      Base URL to be used API endpoint.
    • getApiBaseUri

      public String getApiBaseUri()
      Get the current configured API endpoint base URI.
      Returns:
      Base URI to be used API endpoint.
    • getCamera

      public com.trimblemaps.mapsdk.camera.CameraPosition getCamera()
      Get the current configured initial camera position for a map view.
      Returns:
      CameraPosition to be initially used.
    • getMinZoomPreference

      public double getMinZoomPreference()
      Get the current configured min zoom for a map view.
      Returns:
      Mininum zoom level to be used.
    • getMaxZoomPreference

      public double getMaxZoomPreference()
      Get the current configured maximum zoom for a map view.
      Returns:
      Maximum zoom to be used.
    • getMinPitchPreference

      public double getMinPitchPreference()
      Get the current configured min pitch for a map view.
      Returns:
      Mininum pitch to be used.
    • getMaxPitchPreference

      public double getMaxPitchPreference()
      Get the current configured maximum pitch for a map view.
      Returns:
      Maximum pitch to be used.
    • getCompassEnabled

      public boolean getCompassEnabled()
      Get the current configured visibility state for trimblemaps_compass_icon for a map view.
      Returns:
      Visibility state of the trimblemaps_compass_icon
    • getCompassGravity

      public int getCompassGravity()
      Get the current configured gravity state for trimblemaps_compass_icon for a map view.
      Returns:
      Gravity state of the trimblemaps_compass_icon
    • getCompassMargins

      public int[] getCompassMargins()
      Get the current configured margins for trimblemaps_compass_icon for a map view.
      Returns:
      Margins state of the trimblemaps_compass_icon
    • getCompassFadeFacingNorth

      public boolean getCompassFadeFacingNorth()
      Get the current configured state for fading the trimblemaps_compass_icon when facing north.
      Returns:
      True if trimblemaps_compass_icon fades to invisible when facing north
    • getCompassImage

      public android.graphics.drawable.Drawable getCompassImage()
      Get the current configured CompassView image.
      Returns:
      the drawable used as compass image
    • getLogoEnabled

      public boolean getLogoEnabled()
      Get the current configured visibility state for trimblemaps_compass_icon for a map view.
      Returns:
      Visibility state of the trimblemaps_compass_icon
    • getLogoGravity

      public int getLogoGravity()
      Get the current configured gravity state for logo for a map view.
      Returns:
      Gravity state of the logo
    • getLogoMargins

      public int[] getLogoMargins()
      Get the current configured margins for logo for a map view.
      Returns:
      Margins state of the logo
    • getRotateGesturesEnabled

      public boolean getRotateGesturesEnabled()
      Get the current configured rotate gesture state for a map view.
      Returns:
      True indicates gesture is enabled
    • getScrollGesturesEnabled

      public boolean getScrollGesturesEnabled()
      Get the current configured scroll gesture state for a map view.
      Returns:
      True indicates gesture is enabled
    • getHorizontalScrollGesturesEnabled

      public boolean getHorizontalScrollGesturesEnabled()
      Get the current configured horizontal scroll gesture state for a map view.
      Returns:
      True indicates horizontal scroll gesture is enabled
    • getTiltGesturesEnabled

      public boolean getTiltGesturesEnabled()
      Get the current configured tilt gesture state for a map view.
      Returns:
      True indicates gesture is enabled
    • getZoomGesturesEnabled

      public boolean getZoomGesturesEnabled()
      Get the current configured zoom gesture state for a map view.
      Returns:
      True indicates gesture is enabled
    • getDoubleTapGesturesEnabled

      public boolean getDoubleTapGesturesEnabled()
      Get the current configured double tap gesture state for a map view.
      Returns:
      True indicates gesture is enabled
    • getQuickZoomGesturesEnabled

      public boolean getQuickZoomGesturesEnabled()
      Get whether the user may zoom the map by tapping twice, holding and moving the pointer up and down.
      Returns:
      True indicates gesture is enabled
    • getAttributionEnabled

      public boolean getAttributionEnabled()
      Get the current configured visibility state for attribution for a map view.
      Returns:
      Visibility state of the attribution
    • getAttributionGravity

      public int getAttributionGravity()
      Get the current configured gravity state for attribution for a map view.
      Returns:
      Gravity state of the logo
    • getAttributionMargins

      public int[] getAttributionMargins()
      Get the current configured margins for attribution for a map view.
      Returns:
      Margins state of the logo
    • getAttributionTintColor

      @ColorInt public int getAttributionTintColor()
      Get the current configured tint color for attribution for a map view.
      Returns:
      the tint color
    • getDebugActive

      public boolean getDebugActive()
      Get the current configured debug state for a map view.
      Returns:
      True indicates debug is enabled.
    • getTextureMode

      public boolean getTextureMode()
      Returns true if TextureView is being used the render view.
      Returns:
      True if TextureView is used.
    • getTranslucentTextureSurface

      public boolean getTranslucentTextureSurface()
      Returns true if TextureView supports a translucent surface
      Returns:
      True if translucent surface is active
    • getForegroundLoadColor

      @ColorInt public int getForegroundLoadColor()
      Returns the current configured foreground color that is used during map creation.
      Returns:
      the load color
    • getLocalIdeographFontFamily

      @Nullable public String getLocalIdeographFontFamily()
      Returns the font-family for locally overriding generation of glyphs in the 'CJK Unified Ideographs' and 'Hangul Syllables' ranges. Default font for local ideograph font family is TrimbleMapsConstants.DEFAULT_FONT. Returns null if local ideograph font families are disabled.
      Returns:
      Local ideograph font family name.
    • isLocalIdeographFontFamilyEnabled

      public boolean isLocalIdeographFontFamilyEnabled()
      Returns true if local ideograph font family is enabled, defaults to true.
      Returns:
      True if local ideograph font family is enabled
    • getPixelRatio

      public float getPixelRatio()
      Return the custom configured pixel ratio, returns 0 if not configured.
      Returns:
      the pixel ratio used by the map under construction
    • describeContents

      public int describeContents()
      Specified by:
      describeContents in interface android.os.Parcelable
    • writeToParcel

      public void writeToParcel(@NonNull android.os.Parcel dest, int flags)
      Specified by:
      writeToParcel in interface android.os.Parcelable
    • equals

      public boolean equals(@Nullable Object o)
      Overrides:
      equals in class Object
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object