@arcgis/core
Version:
ArcGIS Maps SDK for JavaScript: A complete 2D and 3D mapping and data visualization API
74 lines (72 loc) • 4.77 kB
TypeScript
import type Accessor from "../core/Accessor.js";
import type Collection from "../core/Collection.js";
import type Extent from "../geometry/Extent.js";
import type ElevationSampler from "../layers/support/ElevationSampler.js";
import type LayerView from "./layers/LayerView.js";
export interface GroundViewProperties {}
/**
* This class represents the view for the [Ground](https://developers.arcgis.com/javascript/latest/references/core/Ground/) of a map. It can be used to
* [sample elevation](https://developers.arcgis.com/javascript/latest/references/core/views/GroundView/#elevationSampler) from the terrain surface that is currently visible in the view or to access the
* [LayerViews](https://developers.arcgis.com/javascript/latest/references/core/views/layers/LayerView/) of the [Ground.layers](https://developers.arcgis.com/javascript/latest/references/core/Ground/#layers) in the ground.
* An instance of this class can be accessed through [SceneView.groundView](https://developers.arcgis.com/javascript/latest/references/core/views/SceneView/#groundView).
*
* @since 4.7
* @see [SceneView.groundView](https://developers.arcgis.com/javascript/latest/references/core/views/SceneView/#groundView)
* @see [ElevationLayer.createElevationSampler()](https://developers.arcgis.com/javascript/latest/references/core/layers/ElevationLayer/#createElevationSampler)
* @see [ElevationSampler](https://developers.arcgis.com/javascript/latest/references/core/layers/support/ElevationSampler/)
*/
export default class GroundView extends Accessor {
constructor(properties?: GroundViewProperties);
/**
* An elevation sampler that may be used to sample and query elevation values from the ground surface that is
* currently being displayed.
*
* The elevation sampler is not supported for [MapView](https://developers.arcgis.com/javascript/latest/references/core/views/MapView/) and may be `null` while the
* ground surface display is being initialized.
*
* The resolution of the sampled values depends on the ground elevation display resolution (high resolution close to
* the camera, low resolution far away from the camera). Because of the dynamic nature of the display resolution, the
* [ElevationSampler.demResolution](https://developers.arcgis.com/javascript/latest/references/core/layers/support/ElevationSampler/#demResolution) property of the returned sampler
* is not fixed and will change based on the data loaded by the view.
*
* If higher or more consistent sample resolution is required, then consider creating a sampler at the desired
* resolution using
* [ElevationLayer.createElevationSampler()](https://developers.arcgis.com/javascript/latest/references/core/layers/ElevationLayer/#createElevationSampler) or
* [Ground.createElevationSampler()](https://developers.arcgis.com/javascript/latest/references/core/Ground/#createElevationSampler).
*
* @example
* let elevationSampler = view.groundView.elevationSampler;
* // watch for changes in the elevationSampler
* elevationSampler.on('changed', function() {
* // get z-values from the elevation displayed in the view
* let zEnrichedGeometry = elevationSampler.queryElevation(geometry);
* });
*/
get elevationSampler(): ElevationSampler | null;
/**
* The extent represents the visible portion of ground within the view as
* an instance of [Extent](https://developers.arcgis.com/javascript/latest/references/core/geometry/Extent/). The ground view extent is computed based
* on the ground surface elevation at the center of the view, while the
* [SceneView extent](https://developers.arcgis.com/javascript/latest/references/core/views/SceneView/#extent) is computed at the elevation of
* all of the scene content at the center of the view. The ground view extent may be more
* appropriate when synchronizing the viewpoint of a [MapView](https://developers.arcgis.com/javascript/latest/references/core/views/MapView/) and a
* [SceneView](https://developers.arcgis.com/javascript/latest/references/core/views/SceneView/).
*
* @since 4.28
*/
get extent(): Extent | null | undefined;
/**
* A collection containing a hierarchical list of all the created
* [LayerViews](https://developers.arcgis.com/javascript/latest/references/core/views/layers/LayerView/) of the
* [Ground.layers](https://developers.arcgis.com/javascript/latest/references/core/Ground/#layers) in the ground.
*
* @see [LayerView](https://developers.arcgis.com/javascript/latest/references/core/views/layers/LayerView/)
*/
get layerViews(): Collection<LayerView>;
/**
* Value is `true` when any of the ground layer views are updating.
*
* @default false
*/
get updating(): boolean;
}