Class MapTilerOnlineTileDataSource

java.lang.Object
com.massifmaps.datasources.TileDataSource
com.massifmaps.datasources.MapTilerOnlineTileDataSource

public class MapTilerOnlineTileDataSource extends TileDataSource
An online tile data source that connects to MapTiler Cloud tile server.
This data source should be used with vector tiles,
though by customizing service URL could be used with raster tiles also.
Be sure to read the Terms and Conditions of your MapTiler service provider to see if the
service is available for your application.
Note: this class is experimental and may change or even be removed in future SDK versions.
  • Constructor Details

    • MapTilerOnlineTileDataSource

      public MapTilerOnlineTileDataSource(String key)
      Constructs a MapTilerOnlineTileDataSource object.
      Parameters:
      key - The access key (access token) to use registered with MapTiler.
  • Method Details

    • getCustomServiceURL

      public String getCustomServiceURL()
      Returns the custom backend service URL.
      Returns:
      The custom backend service URL. If this is not defined, an empty string is returned.
    • setCustomServiceURL

      public void setCustomServiceURL(String serviceURL)
      Sets the custom backend service URL.
      The custom URL may contain tag "{key}" which will be substituted with the set access key.
      Parameters:
      serviceURL - The custom backend service URL to use. If this is empty, then the default service is used.
    • getTimeout

      public int getTimeout()
      Returns the current timeout value.
      Returns:
      The current timeout value in seconds. If negative, then default platform-specific timeout is used.
    • setTimeout

      public void setTimeout(int timeout)
      Sets the current timeout value.
      Parameters:
      timeout - The new timeout value in seconds. If negative, then default platform-specific timeout is used.
    • loadTile

      public TileData loadTile(MapTile mapTile)
      Description copied from class: TileDataSource
      Loads the specified tile.
      Note: the tile coordinate system used here is vertically flipped relative to layer tile coordinate system.
      Overrides:
      loadTile in class TileDataSource
      Parameters:
      mapTile - The tile to load.
      Returns:
      The tile data. If the tile is not available, null may be returned.