A layer that can visualize data from an ArcGIS map service using dynamically generated map images. More...
Header: | #include <ArcGISMapImageLayer.h> |
Since: | Esri::ArcGISRuntime 100.0 |
Inherits: | Esri::ArcGISRuntime::ImageAdjustmentLayer, Esri::ArcGISRuntime::RemoteResource, and Esri::ArcGISRuntime::TimeAware |
Public Functions
ArcGISMapImageLayer(const QUrl &url, QObject *parent = nullptr) | |
ArcGISMapImageLayer(Esri::ArcGISRuntime::Item *item, QObject *parent = nullptr) | |
ArcGISMapImageLayer(const QUrl &url, Esri::ArcGISRuntime::Credential *credential, QObject *parent = nullptr) | |
virtual | ~ArcGISMapImageLayer() override |
QString | geodatabaseVersion() const |
Esri::ArcGISRuntime::MapServiceImageFormat | imageFormat() const |
QFuture<void> | loadTablesAndLayersAsync() |
Esri::ArcGISRuntime::ArcGISSublayerListModel * | mapImageSublayers() const |
Esri::ArcGISRuntime::ArcGISMapServiceInfo | mapServiceInfo() const |
quint64 | refreshInterval() const |
void | resetSublayers() |
void | setGeodatabaseVersion(const QString &geodatabaseVersion) |
void | setImageFormat(Esri::ArcGISRuntime::MapServiceImageFormat imageFormat) |
void | setRefreshInterval(quint64 milliseconds) |
QList<Esri::ArcGISRuntime::ServiceFeatureTable *> | tables() const |
Reimplemented Public Functions
virtual Esri::ArcGISRuntime::Credential * | credential() const override |
virtual Esri::ArcGISRuntime::TimeExtent | fullTimeExtent() const override |
virtual bool | isSupportsTimeFiltering() const override |
virtual bool | isTimeFilteringEnabled() const override |
virtual Esri::ArcGISRuntime::RequestConfiguration | requestConfiguration() const override |
virtual void | setRequestConfiguration(const Esri::ArcGISRuntime::RequestConfiguration &requestConfiguration) override |
virtual void | setTimeFilteringEnabled(bool timeFilteringEnabled) override |
virtual void | setTimeOffset(const Esri::ArcGISRuntime::TimeValue &timeOffset) override |
virtual Esri::ArcGISRuntime::TimeValue | timeInterval() const override |
virtual Esri::ArcGISRuntime::TimeValue | timeOffset() const override |
virtual QUrl | url() const override |
Signals
void | fullTimeExtentChanged() |
Detailed Description
An ArcGIS map image layer displays a map from an ArcGIS MapServer REST service endpoint. Each time a request is made to the map server, layers contained in the map are rendered by the server and returned to the client as a single image of the map. While the image itself does not contain information about the features it displays, you can access and control the visual appearance of the layers using the mapImageSublayers collection.
Functional characteristics
Map images are created and returned by the server on every request, so they show the latest data at the time of the request. You can specify characteristics of the image, such as ImageAdjustmentLayer::brightness, ImageAdjustmentLayer::contrast, ImageAdjustmentLayer::gamma, and Layer::opacity. If you obtain the associated sublayers of the ArcGISMapImageLayer using the mapImageSublayers property, you can control the sublayer's visibility and its ArcGISSublayer::definitionExpression. If you want the background color for the map image to be transparent, you must set the imageFormat to PNG.
The underlying ServiceFeatureTable, for each map image sublayer or for non-spatial tables used in the service, can be accessed via the tables property. These tables can be queried using any valid combination of attribute, spatial, and temporal criteria via the numerous query methods. You can also query for FeatureTable::queryStatisticsAsync(const Esri::ArcGISRuntime::StatisticsQueryParameters&, QObject*) to see summary statistics or to find related features in other tables via the numerous query methods.
This layer supports time-based filtering.
Performance characteristics
The ArcGIS map service creates map images on the fly. This rendering time depends on the amount and complexity of the data in the map. It will typically be slower than fetching the equivalent map as previously rendered and cached tiles via an ArcGISTiledLayer. Because the server renders the map, map image layers require less processing time on the client than similar maps rendered locally.
ArcGIS map image layers are good candidates for showing features that change periodically, or that require filtering by the user. Although rendering occurs on the server, you have access to service feature tables for all sublayers (as well as non-spatial tables and relationships).
Example:
Create an ArcGISMapImageLayer from a URL to the REST endpoing of a dynamic map service:
const QUrl& serviceUrl = url_waterNetworkMapServer; // e.g. "http://sampleserver6.arcgisonline.com/arcgis/rest/services/Water_Network/MapServer" auto* layer = new ArcGISMapImageLayer(serviceUrl, this);
For samples, see:
Relevant samples:
- Analyze hotspots: Use a geoprocessing service and a set of features to identify statistically significant hot spots and cold spots.
- ArcGIS map image layer (URL): Display a layer from an ArcGIS map image layer service.
- Change sublayer renderer: Apply a renderer to a sublayer.
- Change sublayer visibility: Change the visibility of sublayers.
- Local server geoprocessing: Create contour lines from local raster data using a local geoprocessing package `.gpkx` and the contour geoprocessing tool.
- Local Server map image layer: Start the Local Server and Local Map Service, create an ArcGIS Map Image Layer from the Local Map Service, and add it to a map.
- Manage operational layers: Add, remove, and reorder operational layers in a map.
- Query map image sublayer: Find features in a sublayer based on attributes and location.
- Set map spatial reference: Specify a map's spatial reference.
See also Layer and ImageAdjustmentLayer.
Member Function Documentation
[explicit]
ArcGISMapImageLayer::ArcGISMapImageLayer (const QUrl &url, QObject *parent = nullptr)
Creates an ArcGIS map image layer from the specified URL.
- url - The URL to the endpoint of an ArcGIS map service or to an ArcGIS map service portal item.
- parent - The optional parent QObject.
If the specified URL is a map service URL, the MapServer must have "Single Fused Map Cache" set to false
in its ArcGIS REST Services Directory. If the specified URL is a portal item URL, the underlying PortalItem is created and can be accessed through Layer::item. See PortalItem::PortalItem(const QUrl&, QObject*) for the supported URL formats.
See also PortalItem, PortalItem::PortalItem(const QUrl&, QObject*), and Layer::item.
[explicit]
ArcGISMapImageLayer::ArcGISMapImageLayer (Esri::ArcGISRuntime::Item *item, QObject *parent = nullptr)
Creates an ArcGIS map image layer from a PortalItem representing an ArcGIS map service.
- item - A portal item of type PortalItemType::MapService.
- parent - The optional parent QObject.
The item's type should be PortalItemType::MapService.
See also Layer::item.
ArcGISMapImageLayer::ArcGISMapImageLayer (const QUrl &url, Esri::ArcGISRuntime::Credential *credential, QObject *parent = nullptr)
Constructor that accepts the service URL (url), a credential, and an optional parent.
Credential are applied if the provided URL is to a secured service.
[override virtual]
ArcGISMapImageLayer::~ArcGISMapImageLayer ()
Destructor.
[override virtual]
Esri::ArcGISRuntime::Credential *ArcGISMapImageLayer::credential() const
Reimplements: RemoteResource::credential() const.
Returns the security credential used to access the map service. Only applicable if the service is secured.
[override virtual, since Esri::ArcGISRuntime 100.3]
Esri::ArcGISRuntime::TimeExtent ArcGISMapImageLayer::fullTimeExtent () const
Reimplements: TimeAware::fullTimeExtent() const.
Returns the full time extent of the layer.
If the layer, such as an ArcGISMapImageLayer, has sublayers with different time extents, fullTimeExtent is a union of its sublayer's time extents.
This function was introduced in Esri::ArcGISRuntime 100.3.
[signal, since Esri::ArcGISRuntime 100.3]
void ArcGISMapImageLayer::fullTimeExtentChanged ()
Signal emitted when the fullTimeExtent changes for this layer.
This function was introduced in Esri::ArcGISRuntime 100.3.
See also TimeAware.
QString ArcGISMapImageLayer::geodatabaseVersion () const
Returns the geodatabase version of the map image layer.
See also setGeodatabaseVersion().
Esri::ArcGISRuntime::MapServiceImageFormat ArcGISMapImageLayer::imageFormat () const
Returns the image format used to generate map images on this layer.
If imageFormat value is MapServiceImageFormat::Default, the default image format is defined by the service.
See also setImageFormat().
[override virtual, since Esri::ArcGISRuntime 100.3]
bool ArcGISMapImageLayer::isSupportsTimeFiltering () const
Reimplements: TimeAware::isSupportsTimeFiltering() const.
Returns true
if the layer supports filtering data based on its time values, false
otherwise.
This function was introduced in Esri::ArcGISRuntime 100.3.
[override virtual, since Esri::ArcGISRuntime 100.3]
bool ArcGISMapImageLayer::isTimeFilteringEnabled () const
Reimplements: TimeAware::isTimeFilteringEnabled() const.
Returns true
if the layer filters data based on its GeoView::timeExtent, false
otherwise.
This is only applicable if the layer's isSupportsTimeFiltering value is true
. If the GeoView::timeExtent value is empty, no time filtering is applied and all content is rendered.
This function was introduced in Esri::ArcGISRuntime 100.3.
[since Esri::ArcGISRuntime 200.2]
QFuture<void> ArcGISMapImageLayer::loadTablesAndLayersAsync ()
Loads all of the map service's sublayers and non spatial tables.
This method returns a QFuture for the asynchronous operation. Use future.then() to continue processing when the operation completes. Use future.onFailed() to handle exceptions of type ErrorException.
See Working with QFuture for further details.
This function was introduced in Esri::ArcGISRuntime 200.2.
Esri::ArcGISRuntime::ArcGISSublayerListModel *ArcGISMapImageLayer::mapImageSublayers () const
Returns the sublayers of an ArcGIS map image layer.
The collection is specific to a layer so you can't reuse a sublayer collection coming from another ArcGISMapImageLayer or ArcGISSublayer. You have to create a new layer collection.
See also ArcGISSublayer and ArcGISSublayer::sublayers.
Esri::ArcGISRuntime::ArcGISMapServiceInfo ArcGISMapImageLayer::mapServiceInfo () const
Returns the ArcGIS map service information.
This information is available after the layer has successfully loaded.
[since Esri::ArcGISRuntime 100.1]
quint64 ArcGISMapImageLayer::refreshInterval () const
Returns the refresh interval used by the layer, in milliseconds.
Layers request images from the service each time this interval elapses.
A value of 0 means the layer is never refreshed.
This function was introduced in Esri::ArcGISRuntime 100.1.
See also setRefreshInterval().
[override virtual, since Esri::ArcGISRuntime 100.1]
Esri::ArcGISRuntime::RequestConfiguration ArcGISMapImageLayer::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().
[since Esri::ArcGISRuntime 100.1]
void ArcGISMapImageLayer::resetSublayers ()
Resets the sublayers of a map image layer to the default values defined by the service.
After this call, any changes to the sublayers (either by using an ArcGISMapImageSublayer setter or by changing the sublayer collections) are lost. The sublayer hierarchy returns to its initial state (defined by the service) and image requests to display the layer will no longer use the dynamic layer capabilities of the service. All ArcGISMapImageSublayer objects will be recreated.
This function was introduced in Esri::ArcGISRuntime 100.1.
See also ArcGISSublayer::sublayers.
void ArcGISMapImageLayer::setGeodatabaseVersion (const QString &geodatabaseVersion )
Sets the geodatabaseVersion to geodatabaseVersion.
See also geodatabaseVersion.
void ArcGISMapImageLayer::setImageFormat (Esri::ArcGISRuntime::MapServiceImageFormat imageFormat )
Sets the imageFormat to an imageFormat.
See also imageFormat.
[since Esri::ArcGISRuntime 100.1]
void ArcGISMapImageLayer::setRefreshInterval (quint64 milliseconds)
Sets the refresh interval used by the layer to milliseconds.
Layers request images from the service each time this interval elapses.
A value of 0 means the layer is never refreshed.
This function was introduced in Esri::ArcGISRuntime 100.1.
See also refreshInterval().
[override virtual, since Esri::ArcGISRuntime 100.1]
void ArcGISMapImageLayer::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().
[override virtual, since Esri::ArcGISRuntime 100.3]
void ArcGISMapImageLayer::setTimeFilteringEnabled (bool timeFilteringEnabled )
Reimplements: TimeAware::setTimeFilteringEnabled(bool timeFilteringEnabled).
Sets the timeFilteringEnabled to timeFilteringEnabled.
This function was introduced in Esri::ArcGISRuntime 100.3.
See also isTimeFilteringEnabled.
[override virtual, since Esri::ArcGISRuntime 100.3]
void ArcGISMapImageLayer::setTimeOffset (const Esri::ArcGISRuntime::TimeValue &timeOffset )
Reimplements: TimeAware::setTimeOffset(const Esri::ArcGISRuntime::TimeValue &timeOffset).
Sets the timeOffset to timeOffset.
This function was introduced in Esri::ArcGISRuntime 100.3.
See also timeOffset.
[since Esri::ArcGISRuntime 100.3]
QList<Esri::ArcGISRuntime::ServiceFeatureTable *> ArcGISMapImageLayer::tables() const
Returns the read-only collection of non-spatial tables in the map image layer.
The collection is specific to this map image layer. Tables are not loaded by default. You can load a table by calling FeatureTable::load or loadTablesAndLayersAsync. Alternatively, tables are loaded internally when asynchronous operations like query are performed.
This function was introduced in Esri::ArcGISRuntime 100.3.
See also FeatureTable.
[override virtual, since Esri::ArcGISRuntime 100.3]
Esri::ArcGISRuntime::TimeValue ArcGISMapImageLayer::timeInterval () const
Reimplements: TimeAware::timeInterval() const.
Returns the suggested time slider step size for this time aware layer.
You can use this information to set the step size for a time slider control. The value is empty if no time interval is suggested. The author of the layer's data typically configures this property if the data has been collected on a regular basis. For example, the daily position of a hurricane.
This information can be used to set the step size for a time slider control.
This function was introduced in Esri::ArcGISRuntime 100.3.
[override virtual, since Esri::ArcGISRuntime 100.3]
Esri::ArcGISRuntime::TimeValue ArcGISMapImageLayer::timeOffset () const
Reimplements: TimeAware::timeOffset() const.
Returns the amount of time by which the temporal values of this layer's data points are offset when displaying it in a GeoView.
The time offset is subtracted from the time extent set on the layer's GeoView. This is useful if you want to overlay data in multiple layers that lies within different temporal extents. For example, if you want to compare data in one layer for a certain year with data in the same layer from the subsequent year, you can create two layers that reference the same data's service endpoint but set the TimeValue in one of the layers to be one year.
This function was introduced in Esri::ArcGISRuntime 100.3.
See also setTimeOffset().
[override virtual]
QUrl ArcGISMapImageLayer::url() const
Reimplements: RemoteResource::url() const.
Returns the URL to the REST endpoint of an ArcGIS map service.
The URL is available after the layer has successfully loaded.
See also ArcGISMapImageLayer(const QUrl&, QObject*).