Displays data from a ArcGIS Map service, by using pre-generated tiles. More...
Header: | #include <ArcGISTiledLayer.h> |
Since: | Esri::ArcGISRuntime 100.0 |
Inherits: | Esri::ArcGISRuntime::ImageTiledLayer, Esri::ArcGISRuntime::ApiKeyResource, and Esri::ArcGISRuntime::RemoteResource |
This class was introduced in Esri::ArcGISRuntime 100.0.
Public Functions
ArcGISTiledLayer(Esri::ArcGISRuntime::TileCache *tileCache, QObject *parent = nullptr) | |
ArcGISTiledLayer(Esri::ArcGISRuntime::Item *item, QObject *parent = nullptr) | |
ArcGISTiledLayer(const QUrl &url, Esri::ArcGISRuntime::Credential *credential, QObject *parent = nullptr) | |
ArcGISTiledLayer(const QUrl &url, QObject *parent = nullptr) | |
virtual | ~ArcGISTiledLayer() override |
Esri::ArcGISRuntime::ArcGISMapServiceInfo | mapServiceInfo() const |
quint64 | refreshInterval() const |
void | setRefreshInterval(quint64 milliseconds) |
Esri::ArcGISRuntime::TileCache * | tileCache() const |
QList<Esri::ArcGISRuntime::ArcGISSublayer *> | tiledSublayers() 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 tiled layers consume raster tiles provided by an ArcGIS service or a tile package. Raster tiles are cached by the server at various scales and the client can request the tiles needed at a particular map extent. The client requests the tiles needed at a particular map extent. You can use the ExportTileCacheTask class to generate and download tiles from the service, creating a tile package (.tpk/.tpkx) for use locally on the device. Alternatively, you can use ArcGIS Pro to create a map tile package and provision it to the device. You can tell if an ArcGIS map server is hosting a compatible ArcGISTiledLayer when "Single Fused Map Cache" is true in the ArcGIS REST Services Directory. See Take a layer offline for more information.
Functional characteristics
ArcGIS tiled layers do not support re-projection, query, select, identify, or editing.
Performance characteristics
Tiled image layers (those that derive functionality from the ImageTiledLayer class) provide fast display of geographic imagery stored in raster files. These rasters typically contain image data acquired from satellite, aircraft, or drones. The resolution of such imagery can be very high, providing a detailed view. With increased resolution comes increased file sizes and potentially slower performance.
Raster tiling is a process that resamples the pixel size at different scales to create images with the appropriate resolution for each scale. The tiling process creates level-of-detail pyramids to efficiently manage how much detail you see as you zoom in and out on the map. Typically, as you zoom closer to the Earth's surface, you want to see greater detail of the geographic information. Tiled image layers allow you to see just the information you need very quickly based on the level-of-detail pyramid at a particular scale, rather than having to load a single large image at once.
Tiles are generated by the server when the service is created. Requests for tiles are made on multiple threads and handled asynchronously. The size of each returned tile increases as the resolution increases.
The number and content of these map tiles is defined by the service's tiling scheme and the map document that the service is based on. The tiling scheme specifies parameters such as tile dimensions, image format, scale levels, and so on. As you navigate the map, the layer fetches new map tiles to be displayed.
The spatial reference of an ArcGISTiledLayer must match the map's spatial reference. This is necessary because tiled layers display pre-generated map tiles that cannot be reprojected to match a different spatial reference.
Unlike ArcGISMapImageLayers, you cannot modify properties of an ArcGISTiledLayer to alter map contents. This is because the layer relies on a cached map service that does not create map images on-the-fly like a dynamic map service does.
Tiles are generated by the server only once when the service is originally created. Requests for tiles are made on multiple threads and handled asynchronously. The size of each returned tile increases as the resolution or complexity of the image in the tile increases. For example, high-resolution imagery tiles can be larger in file size than topographic mapping for the same area and map extent.
The ArcGISTiledLayer does not support re-projection, query, select, identify, or editing.
To construct an ArcGISTiledLayer, provide a URL to a map or image service's REST web service endpoint. You should verify that the service is indeed cached by checking that Single Fused Map Cache property in the Services Directory is set to true. An ArcGISTiledLayer will not work with map services that are not cached.
Alternatively, you can construct an ArcGISTiledLayer with a TileCache or path to a local tile cache.
Example:
Create an ArcGISTiledLayer from a URL to the REST endpoint of an tiled map service:
// create a new tiled layer ArcGISTiledLayer* tiledLayer = new ArcGISTiledLayer(QUrl("https://services.arcgisonline.com/arcgis/rest/services/World_Topo_Map/MapServer"), this); // create a new basemap instance with the tiled layer Basemap* basemap = new Basemap(tiledLayer, this); // create a new map instance m_map = new Map(basemap, this); // set map on the map view m_mapView->setMap(m_map);
Alternatively, you can display tiles offline by creating an ArcGISTiledLayer from a local tile package (*.tpk):
See sample: ArcGIS tiled layer (URL)
See also Layer and ImageTiledLayer.
Member Function Documentation
ArcGISTiledLayer::ArcGISTiledLayer (Esri::ArcGISRuntime::TileCache *tileCache , QObject *parent = nullptr)
Constructor that accepts a TileCache (tileCache) and an optional parent.
ArcGISTiledLayer::ArcGISTiledLayer (Esri::ArcGISRuntime::Item *item, QObject *parent = nullptr)
Constructor that accepts an item (item) and an optional parent.
ArcGISTiledLayer::ArcGISTiledLayer (const QUrl &url, Esri::ArcGISRuntime::Credential *credential, QObject *parent = nullptr)
Constructor that accepts the URL (url), a credential, and an optional parent.
Credential are applied if the provided URL is to a secured service.
ArcGISTiledLayer::ArcGISTiledLayer (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 tile cache. If the specified URL is a portal item URL the underlying PortalItem will be created and accessible through Layer::item.
[override virtual]
ArcGISTiledLayer::~ArcGISTiledLayer ()
Destructor.
[override virtual]
QString ArcGISTiledLayer::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 *ArcGISTiledLayer::credential() const
Reimplements: RemoteResource::credential() const.
Returns the security credential used to access the tiled service.
The credential is available if the service is secured.
Esri::ArcGISRuntime::ArcGISMapServiceInfo ArcGISTiledLayer::mapServiceInfo () const
Gets information about the service.
quint64 ArcGISTiledLayer::refreshInterval () const
Returns the refresh interval used by the layer, in milliseconds.
Layers request tiles from the service each time this interval elapses.
A value of 0 means to never refresh.
This function was introduced in Esri::ArcGISRuntime 100.1.
See also setRefreshInterval().
[override virtual]
Esri::ArcGISRuntime::RequestConfiguration ArcGISTiledLayer::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 ArcGISTiledLayer::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().
void ArcGISTiledLayer::setRefreshInterval (quint64 milliseconds)
Sets the refresh interval used by the layer to milliseconds.
Layers request tiles from the service each time this interval elapses.
A value of 0 means to never refresh.
This function was introduced in Esri::ArcGISRuntime 100.1.
See also refreshInterval().
[override virtual]
void ArcGISTiledLayer::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::TileCache *ArcGISTiledLayer::tileCache () const
Gets the local tile cache.
Returns the TileCache, but only if this ArcGISTiledLayer was created from a local tile cache.
QList<Esri::ArcGISRuntime::ArcGISSublayer *> ArcGISTiledLayer::tiledSublayers () const
Gets a list of sublayers contained in the service.
[override virtual]
QUrl ArcGISTiledLayer::url() const
Reimplements: RemoteResource::url() const.
Gets the URL of the layer's source.
The URL can refer to an online service or a path to a local tile cache.