|
1 |
| -# Distance Measurement Analysis |
| 1 | +# Distance measurement analysis |
2 | 2 |
|
3 |
| -Measure distances within a scene. |
| 3 | +Measure distances between two points in 3D. |
4 | 4 |
|
5 |
| -The distance measurement analysis allows you to add the same measuring experience found in ArcGIS Pro, City Engine, and the ArcGIS API for JavaScript to your app. You can set the unit system of measurement (metric or imperial) and have the units automatically switch to one appropriate for the current scale. The rendering is handled internally so it doesn't interfere with other analyses like viewsheds. |
| 5 | + |
6 | 6 |
|
7 |
| - |
| 7 | +## Use case |
| 8 | + |
| 9 | +The distance measurement analysis allows you to add to your app the same interactive measuring experience found in ArcGIS Pro, City Engine, and the ArcGIS API for JavaScript. You can set the unit system of measurement (metric or imperial). The units automatically switch to one appropriate for the current scale. |
8 | 10 |
|
9 | 11 | ## How to use the sample
|
10 | 12 |
|
11 |
| -Choose a unit system for the measurement in the UI dropdown. Click any location in the scene to start measuring. Move the mouse to an end location, and click to complete the measure. Clicking any new location after this will start a new measurement. |
| 13 | +Choose a unit system for the measurement. Click any location in the scene to start measuring. Move the mouse to an end location, and click to complete the measurement. Click a new location to clear and start a new measurement. |
12 | 14 |
|
13 | 15 | ## How it works
|
14 | 16 |
|
15 |
| -To measure distances with the `LocationDistanceMeasurement` analysis: |
16 |
| - |
17 |
| -1. Create an `AnalysisOverlay` and add it to your scene view's analysis overlay collection: `sceneView.getAnalysisOverlays().add(analysisOverlay)`. |
18 |
| -2. Create a `LocationDistanceMeasurement`, specifying the `startLocation` and `endLocation`. These can be the same point to start with. Add the analysis to the analysis overlay: `analysisOverlay.getAnalyses().add(LocationDistanceMeasurement)`. The measuring line will be drawn for you between the two points. |
19 |
| -3. The `measurementChanged` callback will fire if the distances change. You can get the new values for the `directDistance`, `horizontalDistance`, and `verticalDistance` from the `MeasurementChangedEvent` returned by the callback. The distance objects contain both a scalar value and a unit of measurement. |
| 17 | +1. Create an `AnalysisOverlay` object and add it to the analysis overlay collection of the `SceneView` object. |
| 18 | +2. Specify the start location and end location to create a `LocationDistanceMeasurement` object. Initially, the start and end locations can be the same point. |
| 19 | +3. Add the location distance measurement analysis to the analysis overlay. |
| 20 | +4. The `measurementChanged` callback will trigger if the distances change. You can get the new values for the `directDistance`, `horizontalDistance`, and `verticalDistance` from the `MeasurementChangedEvent` object returned by the callback. |
20 | 21 |
|
21 | 22 | ## Relevant API
|
22 | 23 |
|
23 | 24 | * AnalysisOverlay
|
24 | 25 | * LocationDistanceMeasurement
|
25 |
| -* UnitSystem |
26 | 26 |
|
27 | 27 | ## Additional information
|
28 | 28 |
|
29 |
| -The `LocationDistanceMeasurement` analysis only performs planar distance calculations. This may not be appropriate for large distances where the Earth's curvature needs to be taken into account. |
| 29 | +The `LocationDistanceMeasurement` analysis only performs planar distance calculations. This may not be appropriate for large distances where the Earth's curvature must be considered. |
30 | 30 |
|
31 | 31 | ## Tags
|
32 | 32 |
|
33 |
| -Analysis, 3D |
| 33 | +3D, analysis, distance, measure |
0 commit comments