KmlLayer Class

  • KmlLayer
  • class Esri::ArcGISRuntime::KmlLayer

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

    Header: #include <KmlLayer.h>
    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

    Signals

    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. ArcGIS Runtime provides the ability to read .kml and .kmz files from disk or the network. You can also create, edit, and save a KML layer via the KmlDataset.

    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.

    All coordinates are expressed in latitude and longitude (using decimal degrees), and are based on the SpatialReference::wgs84 geographic coordinate system. Altitude is always expressed in meters. The geographic features can contain attribute information and various styles can be specified to render them. Ground overlays allow images to be displayed for specific geographic objects or draped onto the map itself. Screen overlays allow fixing images to the GeoView, and may be used for compasses, logos, legends, etc. Network links give the ability to reference remote .kml or .kmz files, and refresh them periodically.

    Loading the KmlLayer also loads its underlying KmlDataset, creating one if you didn't supply one through a constructor. The structure of a KML document can be examined through KmlDataset::rootNodes after the KmlDataset has successfully loaded. Missing or inaccessible .kml and .kmz files would cause loading to fail. Missing resources referenced by the KML document (such as images or files referenced via a network link will not prevent the layer from loading.

    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:

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

    Destructor.

    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().

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