@arcgis/core
Version:
ArcGIS Maps SDK for JavaScript: A complete 2D and 3D mapping and data visualization API
115 lines (113 loc) • 6.93 kB
TypeScript
import type Layer from "../../layers/Layer.js";
import type { EventedAccessor } from "../../core/Evented.js";
import type { IdentifiableMixin, IdentifiableMixinProperties } from "../../core/Identifiable.js";
import type { EsriPromiseMixin } from "../../core/Promise.js";
import type { MapViewOrSceneView } from "../MapViewOrSceneView.js";
export interface LayerViewProperties extends IdentifiableMixinProperties {
/**
* When `true`, the layer is visible in the view. Value of this property is inherited from the `layer.visible` unless the developer overrides it.
* The `layerView.visible` will take precedence over `layer.visible` if both properties are set.
*
* @default true
*/
visible?: boolean | null;
}
/**
* Represents the view for a single layer after it has been added to a [Map](https://developers.arcgis.com/javascript/latest/references/core/Map/) in either a [MapView](https://developers.arcgis.com/javascript/latest/references/core/views/MapView/), [Map component](https://developers.arcgis.com/javascript/latest/references/map-components/components/arcgis-map/),
* [SceneView](https://developers.arcgis.com/javascript/latest/references/core/views/SceneView/) or [Scene component](https://developers.arcgis.com/javascript/latest/references/map-components/components/arcgis-scene/).
*
* @since 4.0
* @see [View.whenLayerView()](https://developers.arcgis.com/javascript/latest/references/core/views/View/#whenLayerView)
* @see [MapView.whenLayerView()](https://developers.arcgis.com/javascript/latest/references/core/views/MapView/#whenLayerView)
* @see [SceneView.whenLayerView()](https://developers.arcgis.com/javascript/latest/references/core/views/SceneView/#whenLayerView)
*/
export default abstract class LayerView extends LayerViewSuperclass {
/** The layer this layer view represents. */
get layer(): Layer;
/**
* Indicates if the `spatialReference` of the [MapView](https://developers.arcgis.com/javascript/latest/references/core/views/MapView/#spatialReference) or
* [Map component](https://developers.arcgis.com/javascript/latest/references/map-components/components/arcgis-map/#spatialReference) is supported by the layer view.
* When `false` layer view will be [suspended](https://developers.arcgis.com/javascript/latest/references/core/views/layers/LayerView/#suspended).
*
* > [!WARNING]
* >
* > **Known Limitations**
* >
* > This property is not supported for layer views of a 3D [SceneView](https://developers.arcgis.com/javascript/latest/references/core/views/SceneView/) or [Scene component](https://developers.arcgis.com/javascript/latest/references/map-components/components/arcgis-scene/).
*
* @since 4.23
* @see [suspended](https://developers.arcgis.com/javascript/latest/references/core/views/layers/LayerView/#suspended)
*/
get spatialReferenceSupported(): boolean;
/**
* Value is `true` if the layer is suspended (i.e., layer will not redraw or update
* itself when the extent changes).
*
* @see [spatialReferenceSupported](https://developers.arcgis.com/javascript/latest/references/core/views/layers/LayerView/#spatialReferenceSupported)
*/
get suspended(): boolean;
/**
* Indicates if the layer view is making any updates that will impact what is displayed on the map.
* For example, this value is `true` when renderer, definitionExpression, filter or effect is changed or
* if the layer view is in the process of the fetching data.
*
* Watch [FeatureLayerView.dataUpdating](https://developers.arcgis.com/javascript/latest/references/core/views/layers/FeatureLayerView/#dataUpdating) property instead to only
* know when the data has been updated (e.g. to run statistics query on all feature available in the layer view).
*
* @default false
* @example
* // Check for the first time layerView.updating becomes false. Then query for
* // features that are visible within the view associated with the layer view.
* await reactiveUtils.whenOnce(() => !layerView.updating);
* const query = layerView.createQuery();
* query.geometry = layerView.view.extent;
* const result = layerView.queryFeatures(query);
*/
get updating(): boolean;
/**
* A reference to the [MapView](https://developers.arcgis.com/javascript/latest/references/core/views/MapView/) or [SceneView](https://developers.arcgis.com/javascript/latest/references/core/views/SceneView/) associated with the layer view.
*
* @since 4.28
* @example
* // Check for the first time layerView.updating becomes false. Then query for
* // features that are visible within the view associated with the layer view.
* await reactiveUtils.whenOnce(() => !layerView.updating);
* const query = layerView.createQuery();
* query.geometry = layerView.view.extent;
* const result = layerView.queryFeatures(query);
*/
get view(): MapViewOrSceneView;
/**
* When `true`, the layer is visible in the view. Value of this property is inherited from the `layer.visible` unless the developer overrides it.
* The `layerView.visible` will take precedence over `layer.visible` if both properties are set.
*
* @default true
*/
get visible(): boolean;
set visible(value: boolean | null | undefined);
/**
* When `true`, the layer is visible in the view at the current scale. This applies to layers that have `minScale` and `maxScale` properties set.
*
* > [!WARNING]
* >
* > **Known Limitations**
* >
* > This property isn’t supported for tiled layers in 3D [SceneView](https://developers.arcgis.com/javascript/latest/references/core/views/SceneView/) or in the [Scene component](https://developers.arcgis.com/javascript/latest/references/map-components/components/arcgis-scene/)
*
* @default true
* @since 4.30
* @see [visibleAtCurrentTimeExtent](https://developers.arcgis.com/javascript/latest/references/core/views/layers/LayerView/#visibleAtCurrentTimeExtent)
* @see [suspended](https://developers.arcgis.com/javascript/latest/references/core/views/layers/LayerView/#suspended)
*/
get visibleAtCurrentScale(): boolean;
/**
* When `true`, the layer is visible in the view's [View.timeExtent](https://developers.arcgis.com/javascript/latest/references/core/views/View/#timeExtent). This applies to layers that have a [Layer.visibilityTimeExtent](https://developers.arcgis.com/javascript/latest/references/core/layers/Layer/#visibilityTimeExtent).
*
* @default true
* @since 4.30
* @see [visibleAtCurrentScale](https://developers.arcgis.com/javascript/latest/references/core/views/layers/LayerView/#visibleAtCurrentScale)
* @see [suspended](https://developers.arcgis.com/javascript/latest/references/core/views/layers/LayerView/#suspended)
*/
get visibleAtCurrentTimeExtent(): boolean;
}
declare const LayerViewSuperclass: typeof EventedAccessor & typeof EsriPromiseMixin & typeof IdentifiableMixin