import GroundView from "@arcgis/core/views/GroundView.js";const GroundView = await $arcgis.import("@arcgis/core/views/GroundView.js");- Inheritance:
- GroundView→
Accessor
- Since
- ArcGIS Maps SDK for JavaScript 4.7
This class represents the view for the Ground of a map. It can be used to sample elevation from the terrain surface that is currently visible in the view or to access the LayerViews of the Ground.layers in the ground. An instance of this class can be accessed through SceneView.groundView.
Constructors
Constructor
Parameters
| Parameter | Type | Description | Required |
|---|---|---|---|
| properties | | |
Properties
| Property | Type | Class |
|---|---|---|
declaredClass readonly inherited | ||
elevationSampler readonly | | |
extent readonly | | |
layerViews readonly | | |
updating readonly | |
elevationSampler
- Type
- ElevationSampler | null
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 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 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() or Ground.createElevationSampler().
Example
let elevationSampler = view.groundView.elevationSampler;// watch for changes in the elevationSamplerelevationSampler.on('changed', function() { // get z-values from the elevation displayed in the view let zEnrichedGeometry = elevationSampler.queryElevation(geometry);}); extent
- Since
- ArcGIS Maps SDK for JavaScript 4.28
The extent represents the visible portion of ground within the view as an instance of Extent. The ground view extent is computed based on the ground surface elevation at the center of the view, while the 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 and a SceneView.
layerViews
- Type
- Collection<LayerView>
A collection containing a hierarchical list of all the created LayerViews of the Ground.layers in the ground.
- See also
updating
- Type
- boolean
Value is true when any of the ground layer views are updating.
- Default value
- false