Class WmtsLayer

All Implemented Interfaces:
RemoteResource, LayerContent, Loadable

public final class WmtsLayer extends ImageTiledLayer implements RemoteResource
A layer that can visualize data from a WMTS service by using pre-generated tiles.

Web Map Tile Service (WMTS) is an Open Geospatial Consortium (OGC) standard for delivering geographic data via raster tiles. A WMTS layer uses pre-generated tiles to create a map instead of dynamically generating map images.The service may be hosted in ArcGIS Online, in ArcGIS Enterprise, or in a third party Server. This API supports WMTS 1.0.0.

Functional characteristics

The maps provided by a WMTS service use predefined symbology defined by the server. As a result, it is not possible to apply custom renderers or to visualize feature selection.

A WMTS service can contain multiple layers in a hierarchy. A WMTS layer can be constructed directly with a URL to a service and the uniquely identifying name of the desired layer. Alternatively, a WMTS service can be used to programmatically explore the available layers and allow the user to choose layers at run time.

When creating a WmtsLayer, some WMTS services require that you provide a direct URI to the getCapabilities resource by appending either /1.0.0/WMTSCapabilities.xml or ?service=wmts&request=getCapabilities&version=1.0.0 to the root WMTS URI.

Performance characteristics

WMTS layer consumes raster tiles that were previously rendered and cached by a server. WMTS requires fewer server resources than WMS because the images are rendered and cached ahead of time. WMTS layer requires a connection to the service at all times.

More information and reference samples on the ArcGIS developer website:

Since:
100.1.0
See Also:
  • Constructor Details

  • Method Details

    • copy

      public WmtsLayer copy()
      Creates a deep copy of this WmtsLayer instance.
      Returns:
      a deep copy of this WmtsLayer instance, which means that copies of all fields of this layer are made including its loading state
      Since:
      100.1.0
    • getPreferredImageFormat

      public TileInfo.ImageFormat getPreferredImageFormat()
      The preferred image format used for tiles of this WMTS layer.

      If an image format is not specified when creating this layer, then the value is TileInfo.ImageFormat.UNKNOWN until the layer is loaded.

      Returns:
      the preferred image format
      Since:
      100.1.0
    • getLayerInfo

      public WmtsLayerInfo getLayerInfo()
      Gets the layer info.
      Returns:
      the layer info
      Since:
      100.1.0
    • getLayerId

      public String getLayerId()
      The ID of the WMTS layer.

      getLayerId() cannot be changed on loaded layers, or on layers created from a WmtsLayerInfo.

      Returns:
      the layer ID that was used to construct this layer
      Since:
      100.1.0
    • getTileMatrixSet

      public WmtsTileMatrixSet getTileMatrixSet()
      Gets the WMTS tile matrix set for this WMTS layer.

      If tile matrix set is not specified when creating this layer, or is specified only by name, then the value is null until layer is loaded.

      Returns:
      the tile matrix set
      Since:
      100.1.0
    • getCustomParameters

      public Map<String,String> getCustomParameters()
      Gets the map of custom parameters to be sent with WMTS requests issued by this layer.

      These parameters are appended to GetMap and GetFeatureInfo requests. If a parameter with the same name is defined in WmtsService.getCustomParameters(), then layer-specific values take precedence over service-wide values.

      Returns:
      the dictionary of custom parameters to be sent with WMTS requests issued by this layer
      Since:
      100.6.0
    • setCredential

      public void setCredential(Credential credential)
      Description copied from interface: RemoteResource
      Sets a Credential to be used by the network-enabled resource in the event of an authentication challenge. The default credential is null.

      Only applicable if the resource is secured.

      Specified by:
      setCredential in interface RemoteResource
      Parameters:
      credential - the Credential to be used for authentication
    • getCredential

      public Credential getCredential()
      Description copied from interface: RemoteResource
      Gets the Credential that is set on the network-enabled resource.

      Only applicable if the resource is secured.

      Specified by:
      getCredential in interface RemoteResource
      Returns:
      the Credential, or null if there is none
    • setRequestConfiguration

      public void setRequestConfiguration(RequestConfiguration requestConfiguration)
      Description copied from interface: RemoteResource
      Sets the RequestConfiguration used to modify the parameters of network requests made by this RemoteResource. If not set, the global RequestConfiguration will be used (see RequestConfiguration.getGlobalRequestConfiguration()).
      Specified by:
      setRequestConfiguration in interface RemoteResource
      Parameters:
      requestConfiguration - the RequestConfiguration used to modify network requests
    • getRequestConfiguration

      public RequestConfiguration getRequestConfiguration()
      Description copied from interface: RemoteResource
      Gets the RequestConfiguration used to modify the parameters of network requests made by this RemoteResource.
      Specified by:
      getRequestConfiguration in interface RemoteResource
      Returns:
      the RequestConfiguration used to modify network requests
    • getUri

      public String getUri()
      Gets the URL of the WMTS layer.

      This value cannot be changed on loaded layers, or on layers created from a WmtsLayerInfo.

      Specified by:
      getUri in interface RemoteResource
      Returns:
      the URL of the WMTS layer
      Since:
      100.1.0
    • getTile

      protected byte[] getTile(TileKey tileKey)
      Description copied from class: ImageTiledLayer
      Gets the encoded bytes that represents a tile for the given tile key. The encoding must match TileInfo specified in the constructor ImageTiledLayer(TileInfo, Envelope).
      Specified by:
      getTile in class ImageTiledLayer
      Parameters:
      tileKey - key for the expected tile
      Returns:
      the encoded bytes that represent the tile for the given tile key