import LineOfSightAnalysisObserver from "@arcgis/core/analysis/LineOfSightAnalysisObserver.js";const LineOfSightAnalysisObserver = await $arcgis.import("@arcgis/core/analysis/LineOfSightAnalysisObserver.js");- Inheritance:
- LineOfSightAnalysisObserver→
Accessor
- Since
- ArcGIS Maps SDK for JavaScript 4.23
The LineOfSightAnalysisObserver represents an observer of a LineOfSightAnalysis.
Use the position property to specify the position of the observer.
Constructors
Constructor
Parameters
| Parameter | Type | Description | Required |
|---|---|---|---|
| properties | | |
Properties
| Property | Type | Class |
|---|---|---|
declaredClass readonly inherited | ||
| | ||
| | ||
| |
elevationInfo
- Type
- ElevationInfo | null | undefined
Specifies how the observer is placed on the vertical axis (z). See the ElevationInfo sample for an example of how this property may be used.
ElevationInfo.featureExpressionInfo and ElevationInfo.unit are not supported when the elevation info is specified for this class. If the elevation info is not specified, the effective elevation depends on the position properties of the observer.
feature
- Type
- FeatureReference | null | undefined
References a feature which is excluded from the intersection testing. It is used to ensure that the analysis results remain independent of changes in the level of detail (LOD) of this feature's geometry.
When creating or editing the observer interactively, this property is populated automatically.
Note that you can assign client side graphics which will be taken into account accordingly. However, information about client side graphic will not be persisted and results in an empty reference after de-serialization.
position
A Point representing the position of the observer. Once the position is set, a new line of sight analysis will synchronously calculate the intersection and the visibility to each target of the associated LineOfSightAnalysis.
If the observer is assigned to a LineOfSightLayer then this property must be defined before the layer can be saved to a WebScene.
Methods
fromJSON
- Signature
-
fromJSON (json: any): any
Creates a new instance of this class and initializes it with values from a JSON object
generated from an ArcGIS product. The object passed into the input json
parameter often comes from a response to a query operation in the REST API or a
toJSON()
method from another ArcGIS product. See the Using fromJSON()
topic in the Guide for details and examples of when and how to use this function.
Parameters
| Parameter | Type | Description | Required |
|---|---|---|---|
| json | A JSON representation of the instance in the ArcGIS format. See the ArcGIS REST API documentation for examples of the structure of various input JSON objects. | |
- Returns
- any
Returns a new instance of this class.
clone
- Signature
-
clone (): this
Creates a deep clone of this object. Any properties that store values by reference will be assigned copies of the referenced values on the cloned instance.
- Returns
- this
A deep clone of the class instance that invoked this method.
toJSON
- Signature
-
toJSON (): any
Converts an instance of this class to its ArcGIS portal JSON representation. See the Using fromJSON() guide topic for more information.
- Returns
- any
The ArcGIS portal JSON representation of an instance of this class.