Skip To Content ArcGIS for Developers Sign In Dashboard

ArcGISVectorTiledLayer Class

(Esri::ArcGISRuntime::ArcGISVectorTiledLayer)

A vector tiled layer. More...

Header: #include <ArcGISVectorTiledLayer>
Since: Esri::ArcGISRuntime 100.0
Inherits: Layer and RemoteResource

Public Functions

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

Reimplemented Public Functions

virtual Credential *credential() const
virtual RequestConfiguration requestConfiguration() const
virtual void setRequestConfiguration(const RequestConfiguration &requestConfiguration)
virtual QUrl url() const

Additional Inherited Members

Detailed Description

A vector tiled layer.

ArcGIS vector tiled layers are much like ArcGIS tiled layers. They are a layer in the map loaded from ArcGIS Online, ArcGIS Enterprise, 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 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. The vector tile file format requires much less space than raster tiles. Also, since 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 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 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.

You can download vector tile packages 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 can also be downloaded using an ExportVectorTilesTask which will produce a VectorTileCache which can be used to instantiate the layer. The same task can also create an ItemResourceCache which stores style resources of the vector tile package. The resource cache can be used with the VectorTileCachce to create an ArcGISVectorTiledLayer with a certain 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);

Member Function Documentation

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.

ArcGISVectorTiledLayer::ArcGISVectorTiledLayer(const QUrl &url, 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(Item *item, QObject *parent = nullptr)

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

ArcGISVectorTiledLayer::ArcGISVectorTiledLayer(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(VectorTileCache *vectorTileCache, 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()

Destructor.

[virtual] Credential *ArcGISVectorTiledLayer::credential() const

Reimplemented from RemoteResource::credential().

Returns the security credential used to access the tiled service.

This property is available if the service is secured.

ItemResourceCache *ArcGISVectorTiledLayer::itemResourceCache() const

Returns the item resource cache if present.

This function was introduced in Esri::ArcGISRuntime 100.2.

[virtual] RequestConfiguration ArcGISVectorTiledLayer::requestConfiguration() const

Reimplemented from RemoteResource::requestConfiguration().

Returns the RequestConfiguration in use by this layer.

This function was introduced in Esri::ArcGISRuntime 100.1.

See also setRequestConfiguration().

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

Reimplemented from RemoteResource::setRequestConfiguration().

Sets requestConfiguration used for network requests sent by this layer.

This function was introduced in Esri::ArcGISRuntime 100.1.

See also requestConfiguration().

VectorTileSourceInfo ArcGISVectorTiledLayer::sourceInfo() const

Returns information about the vector tile layer's source.

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

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.

[virtual] QUrl ArcGISVectorTiledLayer::url() const

Reimplemented from RemoteResource::url().

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.

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.


Feedback on this topic?