Skip To Content ArcGIS for Developers Sign In Dashboard

KmlLayer Class

class Esri::ArcGISRuntime::KmlLayer

A layer that can visualize KML data. More...

Header: #include <KmlLayer>
Since: Esri::ArcGISRuntime 100.4
Inherits: Esri::ArcGISRuntime::Layer and Esri::ArcGISRuntime::TimeAware

This class was introduced in Esri::ArcGISRuntime 100.4.

Public Functions

KmlLayer(Esri::ArcGISRuntime::KmlDataset *dataset, QObject *parent = nullptr)
KmlLayer(Esri::ArcGISRuntime::Item *item, QObject *parent = nullptr)
virtual ~KmlLayer() override
Esri::ArcGISRuntime::KmlDataset *dataset() const

Reimplemented Public Functions

virtual Esri::ArcGISRuntime::TimeExtent fullTimeExtent() const override
virtual bool isSupportsTimeFiltering() const override
virtual bool isTimeFilteringEnabled() const 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


Detailed Description

Keyhole Markup Language (KML) is a specification for working with geographic content. KML files can contain 2D and 3D content, as well as links to content from the network.

Functional characteristics

KML represents features as a tree of nodes, including network links, folders, and place marks. Like ArcGIS features, place marks are defined with point, line, or polygon geometry. KML geometry, however, is always based on the WGS84 coordinate system. KML can also have attributes, but unlike ArcGIS feature services, a KML document does not use a schema to define a standard set of fields. ArcGIS Runtime supports version 2.2 of the KML Standard, defined by the Open Geospatial Consortium (OGC).

Unique features of KML include network links and screen overlays. Network links are useful for retrieving network content on a specified interval, which is useful for keeping a live map up to date. Network links can also be used to split a large KML file into multiple per-region KML files, with each being loaded only when the region is in view. Screen overlays can be used to show content, such as branding or a legend, on top of the view. Screen overlay content does not scroll with the map or react to user interaction.

Performance characteristics

KML files can vary significantly in the features they use, including 3D models, network links, and refresh intervals. Not all features are supported in 2D and 3D. For example, 3D models only appear when the KML layer is shown in a scene. Many KML files consist solely of a pointer to another KML file and a refresh interval. For example, the National Weather Service distributes forecast maps in the United States this way.

For samples, see:

  • {sample-create-and-save-kml-file}} {Create and save KML file}
  • {sample-display-kml}} {Display KML}
  • {} {Identify KML features}
  • {} {Edit KML ground overlay}

See also Layer.

Member Function Documentation

KmlLayer::KmlLayer(Esri::ArcGISRuntime::KmlDataset *dataset, QObject *parent = nullptr)

Constructor that takes a dataset and an optional parent.

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

Constructor that takes a Portal Item item and an optional parent.

[signal] void KmlLayer::fullTimeExtentChanged()

Signal emitted when the fullTimeExtent changes for this layer.

See also TimeAware.

[override virtual] KmlLayer::~KmlLayer()


Esri::ArcGISRuntime::KmlDataset *KmlLayer::dataset() const

Returns the KML dataset for this layer.

The KML dataset is the authoritative source for the layer's KML data. The KML dataset should be used when access to the tree of KML nodes is needed (for example to build a legend or toggle node visibility).

[override virtual] Esri::ArcGISRuntime::TimeExtent KmlLayer::fullTimeExtent() const

Reimplements: TimeAware::fullTimeExtent() const.

Returns the full time extent of the layer.

[override virtual] bool KmlLayer::isSupportsTimeFiltering() const

Reimplements: TimeAware::isSupportsTimeFiltering() const.

Returns whether the layer supports filtering its contents by time values.

[override virtual] bool KmlLayer::isTimeFilteringEnabled() const

Reimplements: TimeAware::isTimeFilteringEnabled() const.

Returns whether the layer participates in filtering based on the time extent of its geoview.

[override virtual] void KmlLayer::setTimeFilteringEnabled(bool timeFilteringEnabled)

Reimplements: TimeAware::setTimeFilteringEnabled(bool timeFilteringEnabled).

Sets whether the layer uses the time range defined on the geoview to timeFilteringEnabled.

See also isTimeFilteringEnabled().

[override virtual] void KmlLayer::setTimeOffset(const Esri::ArcGISRuntime::TimeValue &timeOffset)

Reimplements: TimeAware::setTimeOffset(const Esri::ArcGISRuntime::TimeValue &timeOffset).

Sets the time offset of the layer to timeOffset.

The time offset is subtracted from the time extent set on the layer's geoview. This can be used to overlay data from different periods of time for comparison.

See also timeOffset().

[override virtual] Esri::ArcGISRuntime::TimeValue KmlLayer::timeInterval() const

Reimplements: TimeAware::timeInterval() const.

Returns a time interval that represents the suggested step size for use when manipulating the time extent.

This information can be used to set the step size for a time slider control.

[override virtual] Esri::ArcGISRuntime::TimeValue KmlLayer::timeOffset() const

Reimplements: TimeAware::timeOffset() const.

Returns the applied time offset.

See also setTimeOffset().

Feedback on this topic?