Class ArcGISVectorTiledLayer

  • All Implemented Interfaces:
    ApiKeyResource, RemoteResource, LayerContent, Loadable

    public final class ArcGISVectorTiledLayer
    extends Layer
    implements RemoteResource, ApiKeyResource
    Displays data from an ArcGIS vector tiled data source.

    The ArcGIS vector tiled layer is similar to the ArcGIS tiled layer. An ArcGIS vector tiled Layer is loaded from ArcGIS Online, ArcGIS Enterprise, ArcGIS Server, or a local vector tiled layer package file. The tile data format is optimized to reduce network bandwidth and reduce CPU load while rendering the tiles. Vector tiled layers are appropriate for basemap, reference and possibly operational layers. They do not contain any feature data, and do not support identify or search operations.

    Vector tiles are an alternative to raster tile basemap layers. Instead of pixels (raster), the cartography is delivered using 2D points. The points describe lines, polygons or the locations of labels and marker symbols. The file format of tiles is binary and conforms to the Mapbox Vector Tile Specification. The vector tile file format requires much less space than raster tiles. Also, because the cartography is rendered at runtime, the differences between levels of detail appear more continuous than with raster tiles.

    To create a vector tiled layer, the runtime client is given either a URI or a PortalItem. The URI can point to a vector tile source, a vector tile style sheet, or a local vector tile package file. The portal item will contain a URI to a vector tile stylesheet. The style sheet describes the appearance of the geometry and must be in the Mapbox GL Style format. The style sheet also contains a URI to a vector tile source. The source must be in the Mapbox TileJSON format. The source info includes a URI to a default style sheet.

    More than one vector tile style sheet can use the same source. Both the source info and the style sheet are human readable JSON files.

    Vector tile packages can also be downloaded from a ArcGIS Online vector tile service. The vector tile package is a single file (.vptk) that contains all of the tile data files, the source information, a style sheet, and the font and symbol marker resources required to display the map.

    Vector tile packages are also distributed inside Mobile Map Packages. The MMPK contains JSON that points to the location of the vector tile style sheet or the root of the vector tile package data.

    Since:
    100.0.0
    See Also:
    Layer
    • Constructor Detail

      • ArcGISVectorTiledLayer

        public ArcGISVectorTiledLayer​(String dataSourceUri)
        Creates a new ArcGISVectorTiledLayer from either the ArcGIS Vector Tile Service, Vector Tile Style Sheet indicated by the given URI, or the path to a Local Vector tile package(VTPK).
        Parameters:
        dataSourceUri - the Vector Tile Source service URL, Vector Tile Style Sheet URL, Path to local VTPK
        Throws:
        IllegalArgumentException - if dataSourceUri is null or empty
        Since:
        100.0.0
      • ArcGISVectorTiledLayer

        public ArcGISVectorTiledLayer​(PortalItem portalItem)
        Creates a new ArcGISVectorTiledLayer based on the portal item.
        Parameters:
        portalItem - the PortalItem associated with this ArcGISVectorTiledLayer instance
        Throws:
        IllegalArgumentException - if portalItem is null
        Since:
        100.0.0
      • ArcGISVectorTiledLayer

        public ArcGISVectorTiledLayer​(VectorTileCache vectorTileCache)
        Creates a new ArcGISVectorTiledLayer from a vector tile cache.
        Parameters:
        vectorTileCache - the vector tile cache to use
        Throws:
        IllegalArgumentException - if vectorTileCache is null
        Since:
        100.2.0
      • ArcGISVectorTiledLayer

        public ArcGISVectorTiledLayer​(VectorTileCache vectorTileCache,
                                      ItemResourceCache itemResourceCache)
        Creates a new ArcGISVectorTiledLayer from the specified VectorTileCache and ItemResourceCache objects. If itemResourceCache is null, it is equivalent to the constructor ArcGISVectorTiledLayer(VectorTileCache).
        Parameters:
        vectorTileCache - the vector tile cache to use
        itemResourceCache - the vector tile style to use
        Throws:
        IllegalArgumentException - if vectorTileCache is null.
        Since:
        100.2.0
    • Method Detail

      • getSourceInfo

        public VectorTileSourceInfo getSourceInfo()
        Gets the Vector Tile Source info.
        Returns:
        the source info
        Since:
        100.0.0
      • getStyle

        public VectorTileStyle getStyle()
        Gets the VectorTileStyle.
        Returns:
        the style
        Since:
        100.0.0
      • copy

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

        public VectorTileCache getVectorTileCache()
        Gets the underlying vector tile cache for creating the vector tile layer, or null if no vector tile cache is present.

        If this layer was created from a vector tile cache or a local file URI, then this property will return the vector tile cache. If this layer was created from a remote URI, this property will return null.

        Returns:
        the vector tile cache or null if no vector tile cache available
        Since:
        100.2.0
      • getItemResourceCache

        public ItemResourceCache getItemResourceCache()
        Gets the item resource cache or null if no item resource cache is present.
        Returns:
        the item resource cache or null if no item resource cache available
        Since:
        100.2.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.
        Specified by:
        setCredential in interface RemoteResource
        Parameters:
        credential - the Credential to be used for authentication
      • getUri

        public String getUri()
        Description copied from interface: RemoteResource
        Gets the URI of this RemoteResource. Typically this is the URI used to instantiate the object.
        Specified by:
        getUri in interface RemoteResource
        Returns:
        the URI of this RemoteResource
      • getApiKey

        public String getApiKey()
        Description copied from interface: ApiKeyResource
        Gets the API key to access API key enabled services and resources in ArcGIS Online.

        An API key is a unique key used to authorize access to specific services and resources in ArcGIS Online. It is also used to monitor access to those services. An API key is created and managed in the ArcGIS developer dashboard and is tied to a specific ArcGIS account. Setting the API key on a specific ApiKeyResource overrides the default key set on ArcGISRuntimeEnvironment.getApiKey().

        Specified by:
        getApiKey in interface ApiKeyResource
        Returns:
        the API key to access API key enabled services and resources in ArcGIS Online
      • setApiKey

        public void setApiKey​(String apiKey)
        Description copied from interface: ApiKeyResource
        Sets the API key to access API key enabled services and resources in ArcGIS Online.

        An API key is a unique key used to authorize access to specific services and resources in ArcGIS Online. It is also used to monitor access to those services. An API key is created and managed in the ArcGIS developer dashboard and is tied to a specific ArcGIS account. Setting the API key on a specific ApiKeyResource overrides the default key set on ArcGISRuntimeEnvironment.getApiKey().

        Specified by:
        setApiKey in interface ApiKeyResource
        Parameters:
        apiKey - the API key to access API key enabled services and resources in ArcGIS Online