A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://developers.arcgis.com/javascript/latest/sample-code/scene-elevationinfo/index.html below:

Elevation options | Sample Code | ArcGIS Maps SDK for JavaScript 4.33

This sample shows how to change the elevation information of a FeatureLayer for 3D visualization. Various options are available to customize the elevation of features in a 3D scene by modifying the elevationInfo property of a FeatureLayer.

Four properties allow you to customize each feature's elevation: mode, offset, featureExpressionInfo and unit.

Elevation mode sets the type of elevation placement. These are the values that mode can take:

Graphic offset is added to the elevation of all graphics. An offset of 100 moves the symbols 100 units (meters by default) above their existing elevation. Changing the unit to kilometers places the graphics 100km above the ground as shown in the image below:

(z-values are here not considered because featureExpressionInfo is defined)

Custom elevation can be calculated using featureExpressionInfo, which is an Arcade expression that evaluates to a custom elevation value. Once this property is set, zvalues are not considered anymore.

For example, you can do the following to calculate a custom elevation based on a feature's z-value and an attribute:

Use dark colors for code blocks Copy

1
2
3
4
5
6
7
elevationInfo: {
  mode: "relative-to-ground",
  featureExpressionInfo: {
    expression: "Geometry($feature).z * 10 + $feature.HEIGHT100"
  },
  unit: "meters"
}

This is how the graphics would be elevated using this code:

outFields should be defined on the layer when using attributes in expression.

Elevation unit defines the units for featureExpressionInfo and offset. By default it is meters.

Compare this sample to 3D symbols for points to understand the different choices of visualizing 2D features in 3D.


RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4