KmlLayer class final

A layer that can visualize KML data.

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. You can read .kml and .kmz files from disk or the network and 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. This API supports version 2.2 of the KML specification as 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—perfect 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 GeoViewController, 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.

Inheritance
Implemented types

Constructors

KmlLayer(KmlDataset dataset)
Creates a KML layer.
factory
KmlLayer.withItem(Item item)
Creates a new KML layer object from a portal item.
factory

Properties

attribution → String
The attribution text for the layer.
no setterinherited
canChangeVisibility → bool
A flag indicating whether the layer content's visibility can be changed.
no setterinherited
dataset → KmlDataset
The KML dataset providing the content for the layer.
no setter
description ↔ String
The description for the layer.
getter/setter pairinherited
fullExtent → Envelope?
The full extent of this layer, which is the extent where all layer data is contained.
no setterinherited
fullTimeExtent → TimeExtent?
The full time extent of the layer.
no setteroverride
hashCode → int
The hash code for this object.
no setterinherited
id ↔ String
The unique identifying string for the layer, as specified in a map or scene.
getter/setter pairinherited
isIdentifyEnabled → bool
True if the layer supports identify, false otherwise.
no setterinherited
isTimeFilteringEnabled ↔ bool
True if the layer filters data based on its GeoViewController.timeExtent, false otherwise.
getter/setter pairoverride
isVisible ↔ bool
The layer content's visibility.
getter/setter pairinherited
item → Item?
The item the layer has been created from.
no setterinherited
loadError → ArcGISException?
The load error.
no setterinherited
loadStatus → LoadStatus
The load status.
no setterinherited
maxScale ↔ double
The maximum scale for the layer.
getter/setter pairinherited
minScale ↔ double
The minimum scale for the layer.
getter/setter pairinherited
name ↔ String
The layer content's name.
getter/setter pairinherited
onFullTimeExtentChanged → Stream<TimeExtent?>
Sets the callback invoked when the full time extent of the object has changed.
no setteroverride
onLoadStatusChanged → Stream<LoadStatus>
A stream that reports changes to the LoadStatus.
no setterinherited
onSubLayerContentChanged → Stream<List<LayerContent>>
Callback invoked when the sublayer content of the layer content have changed.
no setterinherited
onVisibilityChanged → Stream<bool>
Callback invoked when the visibility of the layer changes.
no setterinherited
opacity ↔ double
The opacity for the layer.
getter/setter pairinherited
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited
showInLegend ↔ bool
A flag indicating whether the layer content participates in the legend.
getter/setter pairinherited
spatialReference → SpatialReference?
The spatial reference of the layer.
no setterinherited
subLayerContents → List<LayerContent>
The sub layer contents of a layer content.
no setterinherited
supportsTimeFiltering → bool
True if the layer supports filtering data based on its time values, false otherwise.
no setteroverride
timeInterval → TimeValue?
The suggested time slider step size for this time aware layer.
no setteroverride
timeOffset ↔ TimeValue?
The amount of time by which the temporal values of this layer's data points are offset when displaying it in a GeoViewController.
getter/setter pairoverride

Methods

cancelLoad() → void
Cancels loading metadata for the object.
inherited
clone() → Layer
Clones this instance of the layer and its members.
inherited
fetchLegendInfos() → Future<List<LegendInfo>>
Fetches the list of legend info.
inherited
isVisibleAtScale(double scale) → bool
Returns the layer content's effective visibility at the specified scale.
inherited
load() → Future<void>
Loads the metadata for the object asynchronously.
inherited
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
retryLoad() → Future<void>
Loads or retries loading metadata for the object asynchronously.
inherited
toString() → String
A string representation of this object.
inherited

Operators

operator ==(Object other) → bool
The equality operator.
inherited