ArcGISVectorTiledLayer Class

  • ArcGISVectorTiledLayer
  • class Esri::ArcGISRuntime::ArcGISVectorTiledLayer

    Displays data from an ArcGIS vector tiled data source. More...

    Header: #include <ArcGISVectorTiledLayer.h>
    Since: Esri::ArcGISRuntime 100.0
    Inherits: Esri::ArcGISRuntime::Layer, Esri::ArcGISRuntime::ApiKeyResource, and Esri::ArcGISRuntime::RemoteResource

    This class was introduced in Esri::ArcGISRuntime 100.0.

    Public Functions

    ArcGISVectorTiledLayer(Esri::ArcGISRuntime::VectorTileCache *vectorTileCache, Esri::ArcGISRuntime::ItemResourceCache *itemResourceCache, QObject *parent = nullptr)
    ArcGISVectorTiledLayer(Esri::ArcGISRuntime::VectorTileCache *vectorTileCache, QObject *parent = nullptr)
    ArcGISVectorTiledLayer(Esri::ArcGISRuntime::Item *item, QObject *parent = nullptr)
    ArcGISVectorTiledLayer(const QUrl &url, Esri::ArcGISRuntime::Credential *credential, QObject *parent = nullptr)
    ArcGISVectorTiledLayer(const QUrl &url, QObject *parent = nullptr)
    virtual ~ArcGISVectorTiledLayer() override
    Esri::ArcGISRuntime::ItemResourceCache *itemResourceCache() const
    Esri::ArcGISRuntime::VectorTileSourceInfo sourceInfo() const
    Esri::ArcGISRuntime::VectorTileStyle style() const
    Esri::ArcGISRuntime::VectorTileCache *vectorTileCache() const

    Reimplemented Public Functions

    virtual QString apiKey() const override
    virtual Esri::ArcGISRuntime::Credential *credential() const override
    virtual Esri::ArcGISRuntime::RequestConfiguration requestConfiguration() const override
    virtual void setApiKey(const QString &apiKey) override
    virtual void setRequestConfiguration(const Esri::ArcGISRuntime::RequestConfiguration &requestConfiguration) override
    virtual QUrl url() const override

    Detailed Description

    ArcGIS vector tiled layers are much like ArcGIS tiled layers. An ArcGIS vector tiled layer consumes vector tiles and an associated style for drawing them. The data source can be a service in ArcGIS Online or ArcGIS Enterprise portal, or local vector tiles in a package (.vtpk file). You can use one of the many styled vector tiled basemaps on ArcGIS Online or create your own with the online style editor. Your customized vector tiled layers can be saved to and read from ArcGIS Online.

    The tile data format is optimized to reduce network bandwidth demand 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, the cartography is delivered using 2-D 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. Because the vector tile file format requires much less space than raster tiles, they take up less disk space and draw more quickly than bitmap-based data. Thus, they also tend to be more suitable for low-bandwidth or offline environments.

    Vector tiles are rendered on the device at runtime and so the differences between levels of detail appear more continuous and crisp regardless of screen size or resolution. Vector tiled layers do not support identify, query, selection, or time, and they cannot be displayed in scenes.

    To create a vector tiled layer, the runtime client is given either a URL or a portal item. The URL 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 URL to a vector tile style sheet, which describes the appearance of the geometry and must be in the Mapbox GL Style format. The style sheet also contains a URL to a vector tile source. The source must be in the Mapbox TileJSON format. The vector tile source info includes a URL to a default style sheet.

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

    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.

    Use ExportVectorTilesTask to generate and download a VectorTileCache (optionally including a custom style) directly to the device as a single-tile .vtpk file which can be used to instantiate the layer. You can use ArcGIS Pro to create a vector tile package and provision it to the device. The same task can also create an ItemResourceCache, which stores style resources of the vector tile package. Or, you can use ArcGIS Pro to create a mobile map package (.mmpk file) that contains a vector tile package and your custom style.

    Example:

    Display the Navigation vector tile layer by using an online service:

    // create a vector tiled basemap
    ArcGISVectorTiledLayer* vectorTiledLayer = new ArcGISVectorTiledLayer(QUrl("https://www.arcgis.com/home/item.html?id=7675d44bb1e4428aa2c30a9b68f97822"), this);
    Basemap* basemap = new Basemap(vectorTiledLayer, this);
    // create a new map instance
    m_map = new Map(basemap, this);

    Alternatively, you can display vector tiles offline by setting the file path to a local vector tile package (*.vtpk):

    // Create a map using a local vector tile package
    ArcGISVectorTiledLayer* vectorTiledLayer = new ArcGISVectorTiledLayer(QUrl::fromLocalFile(m_dataPath + "vtpk/LosAngeles.vtpk"), this);
    Basemap* basemap = new Basemap(vectorTiledLayer, this);
    m_map = new Map(basemap, this);

    See sample: Vector tiled layer (URL)

    See also Layer, LayerContent, Loadable, and RemoteResource.

    Member Function Documentation

    ArcGISVectorTiledLayer::ArcGISVectorTiledLayer(Esri::ArcGISRuntime::VectorTileCache *vectorTileCache, Esri::ArcGISRuntime::ItemResourceCache *itemResourceCache, QObject *parent = nullptr)

    Constructor that accepts a VectorTileCache (vectorTileCache), an ItemResourceCache (itemResourceCache), and an optional parent.

    This function was introduced in Esri::ArcGISRuntime 100.2.

    ArcGISVectorTiledLayer::ArcGISVectorTiledLayer(Esri::ArcGISRuntime::VectorTileCache *vectorTileCache, QObject *parent = nullptr)

    Constructor that accepts a VectorTileCache (vectorTileCache) and an optional parent.

    This function was introduced in Esri::ArcGISRuntime 100.2.

    ArcGISVectorTiledLayer::ArcGISVectorTiledLayer(Esri::ArcGISRuntime::Item *item, QObject *parent = nullptr)

    Constructor that accepts an item (item) and an optional parent.

    ArcGISVectorTiledLayer::ArcGISVectorTiledLayer(const QUrl &url, Esri::ArcGISRuntime::Credential *credential, QObject *parent = nullptr)

    Constructor that accepts the URL (url), a credential, and an optional parent.

    The credential is applied if the provided URL is to a secured service.

    ArcGISVectorTiledLayer::ArcGISVectorTiledLayer(const QUrl &url, QObject *parent = nullptr)

    Constructor that accepts a URL (url) and an optional parent.

    The URL can be to either an online service or a local vector tile cache.

    [override virtual] ArcGISVectorTiledLayer::~ArcGISVectorTiledLayer()

    Destructor.

    [override virtual] QString ArcGISVectorTiledLayer::apiKey() const

    Reimplements: ApiKeyResource::apiKey() const.

    Returns the API key. See ApiKeyResource.

    This function was introduced in Esri::ArcGISRuntime 100.10.

    See also setApiKey().

    [override virtual] Esri::ArcGISRuntime::Credential *ArcGISVectorTiledLayer::credential() const

    Reimplements: RemoteResource::credential() const.

    Returns the security credential used to access the tiled service.

    This property is available if the service is secured.

    Esri::ArcGISRuntime::ItemResourceCache *ArcGISVectorTiledLayer::itemResourceCache() const

    Returns the item resource cache if present.

    This function was introduced in Esri::ArcGISRuntime 100.2.

    [override virtual] Esri::ArcGISRuntime::RequestConfiguration ArcGISVectorTiledLayer::requestConfiguration() const

    Reimplements: RemoteResource::requestConfiguration() const.

    Returns the RequestConfiguration in use by this layer.

    This function was introduced in Esri::ArcGISRuntime 100.1.

    See also setRequestConfiguration().

    [override virtual] void ArcGISVectorTiledLayer::setApiKey(const QString &apiKey)

    Reimplements: ApiKeyResource::setApiKey(const QString &apiKey).

    Sets the API key to apiKey. See ApiKeyResource.

    This function was introduced in Esri::ArcGISRuntime 100.10.

    See also apiKey().

    [override virtual] void ArcGISVectorTiledLayer::setRequestConfiguration(const Esri::ArcGISRuntime::RequestConfiguration &requestConfiguration)

    Reimplements: RemoteResource::setRequestConfiguration(const Esri::ArcGISRuntime::RequestConfiguration &requestConfiguration).

    Sets requestConfiguration used for network requests sent by this layer.

    This function was introduced in Esri::ArcGISRuntime 100.1.

    See also requestConfiguration().

    Esri::ArcGISRuntime::VectorTileSourceInfo ArcGISVectorTiledLayer::sourceInfo() const

    Returns information about the vector tile layer's source.

    The returned VectorTileSource includes name, extent, visible scale, and so on.

    Esri::ArcGISRuntime::VectorTileStyle ArcGISVectorTiledLayer::style() const

    Returns information about the style sheet used with this vector tiled layer.

    The returned VectorTileStyle includes the style sheet's URL, version, and so on.

    [override virtual] QUrl ArcGISVectorTiledLayer::url() const

    Reimplements: RemoteResource::url() const.

    Returns the URL of the layer's source.

    The URL can refer to an online service or a path to a local vector tile cache.

    Esri::ArcGISRuntime::VectorTileCache *ArcGISVectorTiledLayer::vectorTileCache() const

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

    This function was introduced in Esri::ArcGISRuntime 100.2.

    Your browser is no longer supported. Please upgrade your browser for the best experience. See our browser deprecation post for more details.