UNPKG

@arcgis/core

Version:

ArcGIS Maps SDK for JavaScript: A complete 2D and 3D mapping and data visualization API

63 lines (61 loc) 4.41 kB
import type Collection from "../core/Collection.js"; import type Layer from "./Layer.js"; import type KMLSublayer from "./support/KMLSublayer.js"; import type { MultiOriginJSONSupportMixin } from "../core/MultiOriginJSONSupport.js"; import type { BlendLayer, BlendLayerProperties } from "./mixins/BlendLayer.js"; import type { OperationalLayer, OperationalLayerProperties } from "./mixins/OperationalLayer.js"; import type { PortalLayer, PortalLayerProperties } from "./mixins/PortalLayer.js"; import type { RefreshableLayer, RefreshableLayerProperties } from "./mixins/RefreshableLayer.js"; import type { ScaleRangeLayer, ScaleRangeLayerProperties } from "./mixins/ScaleRangeLayer.js"; import type { KMLSublayerProperties } from "./support/KMLSublayer.js"; import type { ReadonlyArrayOrCollection } from "../core/Collection.js"; import type { LayerProperties } from "./Layer.js"; export interface KMLLayerProperties extends LayerProperties, PortalLayerProperties, OperationalLayerProperties, ScaleRangeLayerProperties, RefreshableLayerProperties, BlendLayerProperties, Partial<Pick<KMLLayer, "url">> { /** A collection of [KMLSublayer](https://developers.arcgis.com/javascript/latest/references/core/layers/support/KMLSublayer/)s. */ sublayers?: ReadonlyArrayOrCollection<KMLSublayerProperties> | null; /** The title of the layer used to identify it in places such as the [LayerList](https://developers.arcgis.com/javascript/latest/references/core/widgets/LayerList/) widget. */ title?: string | null; } /** * The KMLLayer class is used to create a layer based on a KML file (.kml, .kmz). * KML is an XML-based file format used to represent geographic features. * * The KMLLayer uses a utility service from [ArcGIS.com](https://www.arcgis.com), therefore your kml/kmz files must be * publicly accessible on the internet. If the kml/kmz files are behind a firewall, you must set the * [esriConfig.kmlServiceUrl](https://developers.arcgis.com/javascript/latest/references/core/config/#Config-kmlServiceUrl) to your own utility service (requires ArcGIS Enterprise). * * > [!WARNING] * > * > **Known Limitations** * > * > Currently, the KMLLayer is not supported in SceneView. * > Currently, the KMLLayer is not supported with the [LayerList](https://developers.arcgis.com/javascript/latest/references/core/widgets/LayerList/) widget. * > [KMLMapImage](https://developers.arcgis.com/javascript/latest/references/core/layers/support/KMLMapImage/) is only supported when the [MapView](https://developers.arcgis.com/javascript/latest/references/core/views/MapView/)'s * > spatial reference is either WGS84 (wkid: 4326) or Web Mercator (wkid: 3857, 102100). * > Inline styles are not supported when displaying pop-ups in KML layers. * > For additional limitations, please refer to the ArcGIS Online [limitations using KML layers](https://doc.arcgis.com/en/arcgis-online/reference/kml.htm) documentation. * * @since 4.5 * @see [Sample - KMLLayer](https://developers.arcgis.com/javascript/latest/sample-code/layers-kml/) * @see [KMLSublayer](https://developers.arcgis.com/javascript/latest/references/core/layers/support/KMLSublayer/) */ export default class KMLLayer extends KMLLayerSuperclass { /** * @example * // Typical usage * KMLLayer = new KMLLayer({ * url: "http://quickmap.dot.ca.gov/data/lcs.kml"// url to the service * }); */ constructor(properties?: KMLLayerProperties); /** A collection of [KMLSublayer](https://developers.arcgis.com/javascript/latest/references/core/layers/support/KMLSublayer/)s. */ get sublayers(): Collection<KMLSublayer> | null | undefined; set sublayers(value: ReadonlyArrayOrCollection<KMLSublayerProperties> | null | undefined); /** The title of the layer used to identify it in places such as the [LayerList](https://developers.arcgis.com/javascript/latest/references/core/widgets/LayerList/) widget. */ accessor title: string | null | undefined; /** The layer type provides a convenient way to check the type of the layer without the need to import specific layer modules. */ get type(): "kml"; /** The publicly accessible URL for a .kml or .kmz file. */ accessor url: string | null | undefined; } declare const KMLLayerSuperclass: typeof Layer & typeof MultiOriginJSONSupportMixin & typeof PortalLayer & typeof OperationalLayer & typeof ScaleRangeLayer & typeof RefreshableLayer & typeof BlendLayer