ArcGISVectorTiledLayer Class

VectorTileCache."> ArcGISVectorTiledLayer Class | ArcGISQtCpp
  • ArcGISVectorTiledLayer
  • class Esri::ArcGISRuntime::ArcGISVectorTiledLayer

    A layer that can visualize data from an ArcGIS vector tile source or a local VectorTileCache. More...

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

    Public Functions

    ArcGISVectorTiledLayer(const QUrl &url, QObject *parent = nullptr)
    ArcGISVectorTiledLayer(const QUrl &url, Esri::ArcGISRuntime::Credential *credential, QObject *parent = nullptr)
    ArcGISVectorTiledLayer(Esri::ArcGISRuntime::Item *item, QObject *parent = nullptr)
    ArcGISVectorTiledLayer(Esri::ArcGISRuntime::VectorTileCache *vectorTileCache, QObject *parent = nullptr)
    ArcGISVectorTiledLayer(Esri::ArcGISRuntime::VectorTileCache *vectorTileCache, Esri::ArcGISRuntime::ItemResourceCache *itemResourceCache, 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

    An ArcGIS Vector Tiled Layer is loaded from ArcGIS online, ArcGIS Enterprise, ArcGIS Server, or a local vector tile 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, search, or editing operations.

    Vector tiles are an alternative to raster tile basemap layers, such as ArcGISTiledLayer. 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 {https://mapbox.github.io/vector-tile-spec/} {Mapbox Vector Tile Specification}. This specification allows a more continuous visual experience between levels of detail compared to raster tiles. The vector tile file format also requires less space than raster tiles.

    You can create a vector tiled layer using 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. The style sheet 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 source info includes a URL 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 an 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.

    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):

    // Load the basemap from a vector tile package
    const QString vtpkDataPath = defaultDataPath() + "/ArcGIS/Runtime/Data/vtpk/FillmoreTopographicMap.vtpk";
    ArcGISVectorTiledLayer* fillmoreVTPK = new ArcGISVectorTiledLayer(QUrl::fromLocalFile(vtpkDataPath), this);
    Basemap* fillmoreBasemap = new Basemap(fillmoreVTPK, this);
    m_map = new Map(fillmoreBasemap, this);

    See sample: Vector tiled layer (URL)

    See also Layer, LayerContent, Loadable, and RemoteResource.

    Member Function Documentation

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

    Creates an ArcGIS Vector Tiled Layer from an ArcGIS Vector Tile Service URL, a Vector Tile Style Sheet URL, or a path to a local vector tile package (.vtpk) file.

    • url - ArcGIS Vector Tile Service URL, an ArcGIS Vector Tile Style Sheet URL, or a path to a local vector tile package (.vtpk) file.
    • parent - The optional parent QObject.

    See also ArcGISVectorTiledLayer().

    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.

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

    Creates an ArcGIS Vector Tiled Layer from a PortalItem.

    • item - An Item.
    • parent - The optional parent QObject.

    See also ArcGISVectorTiledLayer().

    [explicit, since Esri::ArcGISRuntime 100.2] ArcGISVectorTiledLayer::ArcGISVectorTiledLayer(Esri::ArcGISRuntime::VectorTileCache *vectorTileCache, QObject *parent = nullptr)

    Creates an ArcGIS Vector Tiled Layer from a vector tile cache.

    This function was introduced in Esri::ArcGISRuntime 100.2.

    See also ArcGISVectorTiledLayer().

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

    Creates an ArcGIS Vector Tiled Layer from a vector tile cache and an item resource cache containing a custom style for this vector tile layer.

    • vectorTileCache - A VectorTileCache.
    • itemResourceCache - The item resource cache contains a custom style.
    • parent - The optional parent QObject.

    This function was introduced in Esri::ArcGISRuntime 100.2.

    See also ArcGISVectorTiledLayer().

    [override virtual] ArcGISVectorTiledLayer::~ArcGISVectorTiledLayer()

    Destructor.

    [override virtual, since Esri::ArcGISRuntime 100.10] 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.

    [since Esri::ArcGISRuntime 100.2] Esri::ArcGISRuntime::ItemResourceCache *ArcGISVectorTiledLayer::itemResourceCache() const

    Returns the item resource cache contains a custom style that can be applied to this layer.

    This method can only be called if the layer load status is LoadStatus::NotLoaded or LoadStatus::FailedToLoad otherwise ErrorType::CommonIllegalState error will occur.

    This function was introduced in Esri::ArcGISRuntime 100.2.

    See also ArcGISVectorTiledLayer().

    [override virtual, since Esri::ArcGISRuntime 100.1] 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, since Esri::ArcGISRuntime 100.10] void ArcGISVectorTiledLayer::setApiKey(const QString &apiKey)

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

    Returns the apiKey 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.

    In addition to setting an ArcGISRuntimeEnvironment::apiKey at a global level for your application, you can set it on any class that implements ApiKeyResource. This overrides the ArcGISRuntimeEnvironment::apiKey and enables more granular usage telemetry and management of ArcGIS location resources used by your app.

    Classes that expose an API key property by implementing ApiKeyResource include:

    See ApiKeyResource.

    This function was introduced in Esri::ArcGISRuntime 100.10.

    See also apiKey().

    [override virtual, since Esri::ArcGISRuntime 100.1] 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 ArcGIS vector tiled layer.

    See also ArcGISTiledLayer::ArcGISTiledLayer() and ArcGISVectorTiledLayer().

    [since Esri::ArcGISRuntime 100.2] Esri::ArcGISRuntime::VectorTileCache *ArcGISVectorTiledLayer::vectorTileCache() const

    Returns the underlying vector tile cache or nullptr if no vector tile cache is present.

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

    This function was introduced in Esri::ArcGISRuntime 100.2.

    See also ArcGISVectorTiledLayer().

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