Class Source

java.lang.Object
com.trimblemaps.mapsdk.style.sources.Source

public abstract class Source extends Object
Base Peer class for sources. see source.hpp for the other half of the peer.
  • Field Details

    • detached

      protected boolean detached
  • Constructor Details

    • Source

      protected Source(long nativePtr)
      Internal use
      Parameters:
      nativePtr - - pointer to native peer
    • Source

      public Source()
  • Method Details

    • checkThread

      protected void checkThread()
      Validates if source interaction is happening on the UI thread
    • getId

      @NonNull public String getId()
      Retrieve the source id
      Returns:
      the source id
    • getAttribution

      @NonNull public String getAttribution()
      Retrieve the source attribution.

      Will return an empty String if no attribution is available.

      Returns:
      the string representation of the attribution in html format
    • getPrefetchZoomDelta

      @Nullable public Integer getPrefetchZoomDelta()
      Retrieve current pre-fetching zoom delta.
      Returns:
      current zoom delta or null if not set.
    • setPrefetchZoomDelta

      public void setPrefetchZoomDelta(@Nullable Integer delta)
      Set the tile pre-fetching zoom delta for current source. 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. If delta has not been set or set to null, it will use the value in TrimbleMapsMap instance.
      Parameters:
      delta - zoom delta
    • setMaxOverscaleFactorForParentTiles

      public void setMaxOverscaleFactorForParentTiles(@Nullable Integer maxOverscaleFactor)
      When a set of tiles for a current zoom level is being rendered and some of the ideal tiles that cover the screen are not yet loaded, parent tile could be used instead. This might introduce unwanted rendering side-effects, especially for raster tiles that are overscaled multiple times. This method sets the maximum limit for how much a parent tile can be overscaled.
      Parameters:
      maxOverscaleFactor - maximum overscale factor
    • getMaxOverscaleFactorForParentTiles

      @Nullable public Integer getMaxOverscaleFactorForParentTiles()
      Retrieve current maximum overscale factor for parent tiles.
      Returns:
      current maximum overscale factor or null if not set.
    • isVolatile

      @NonNull public Boolean isVolatile()
      Retrieve whether or not the fetched tiles for the given source should be stored in the local cache
      Returns:
      true if tiles are volatile, false if they will be stored in local cache. Default value is false.
    • setVolatile

      public void setVolatile(Boolean value)
      Set a flag defining whether or not the fetched tiles for the given source should be stored in the local cache
      Parameters:
      value - current setting for volatile.
    • setMinimumTileUpdateInterval

      public void setMinimumTileUpdateInterval(Long interval)
      Sets the minimum tile update interval, which is used to throttle the tile update network requests.
      Parameters:
      interval - the update interval in milliseconds.
    • getMinimumTileUpdateInterval

      @NonNull public Long getMinimumTileUpdateInterval()
      Retrieve the minimum tile update interval, which is used to throttle the tile update network requests.
      Returns:
      the update interval in milliseconds, default valuse is 0.
    • getNativePtr

      public long getNativePtr()
      Internal use
      Returns:
      the native peer pointer
    • nativeGetId

      @NonNull protected String nativeGetId()
    • nativeGetAttribution

      @NonNull protected String nativeGetAttribution()
    • nativeGetPrefetchZoomDelta

      @NonNull protected Integer nativeGetPrefetchZoomDelta()
    • nativeSetPrefetchZoomDelta

      protected void nativeSetPrefetchZoomDelta(@Nullable Integer delta)
    • nativeSetMaxOverscaleFactorForParentTiles

      protected void nativeSetMaxOverscaleFactorForParentTiles(@Nullable Integer maxOverscaleFactor)
    • nativeGetMaxOverscaleFactorForParentTiles

      @NonNull protected Integer nativeGetMaxOverscaleFactorForParentTiles()
    • nativeIsVolatile

      @NonNull protected Boolean nativeIsVolatile()
    • nativeSetVolatile

      protected void nativeSetVolatile(@NonNull Boolean value)
    • nativeSetMinimumTileUpdateInterval

      protected void nativeSetMinimumTileUpdateInterval(@NonNull Long interval)
    • nativeGetMinimumTileUpdateInterval

      @NonNull protected Long nativeGetMinimumTileUpdateInterval()
    • setDetached

      public void setDetached()