Line-of-sight analysis, that is, line-of-sight analysis, establishes line-of-sight analysis based on the observer point and target point, and analyzes the results in the scene.
Name | Type | Description |
---|---|---|
scene |
Scene | scene object. |
Throws:
-
DeveloperError : Specify the scene.
Example:
//Create Line-of-Sight Analysis
var sightline = new SuperMap3D.Sightline(scene);
Demo:
Members
-
hiddenColor : Color
-
Get or set the color of the invisible part of the line-of-sight analysis.
Example:
var sightline = new SuperMap3D.Sightline(scene); var color = new SuperMap3D.Color(1, 0, 0); //Set the color of the invisible part sightline .hiddenColor = color; //Get the color of the invisible part var value= sightline .hiddenColor ;
-
Gets or sets the width of the line of sight.
-
Get or set the observer's position. A location is represented by an array of longitude, latitude, and elevation.
Example:
var sightline = new SuperMap3D.Sightline(scene); //Set the position of the observer sightline .viewPosition = [120, 40, 100]; //Get the position of the observer var value= sightline .viewPosition;
-
visibleColor : Color
-
Get or set the visible part color of the line-of-sight analysis.
Example:
var sightline = new SuperMap3D.Sightline(scene); var color = new SuperMap3D.Color(0, 1, 0); //Set the visible part color sightline .visibleColor = color; //Get the visible part color var value= sightline .visibleColor ;
Methods
-
Add target points.
Name Type Description options.position
Array Location information, represented by an array of longitude, latitude, and elevation. options.name
String The name of the target point. Returns:
Returns true if added successfully, otherwise returns false.Example:
var sightline = new SuperMap3D.Sightline(scene); sightline.addTargetPoint({ postion : [120, 40, 50], name : “first” });
-
Perform line-of-sight analysis.
Example:
var sightline = new SuperMap3D.Sightline(scene); sightline.build();
-
Get obstacle point data (deprecated). Replace with getBarrierPointAsync(name, func).
Name Type Description name
String Target point name. func
Callback Callback. Returns:
-
Object.isViewer,Object.position Visible latitude and longitude height.
-
-
Get obstacle point data (deprecated). Replace with getBarrierPointAsync(name, func).
Name Type Description name
String Target point name. func
Callback Callback. Returns:
-
Object.isViewer,Object.position Visible latitude and longitude height.
-
-
Get the IDs collection of all obstacle objects for line-of-sight analysis (deprecated). Replace with getObjectIdsAsync().
Returns:
Return a key-value object where the key is the S3M layer ID, and the value is an array of object IDs. -
Fetch all obstacle object IDs for visibility analysis asynchronously.
Returns:
Return a key-value object where the key is the S3M layer ID, and the value is an array of object IDs. -
Get the viewport visibility corresponding to the layer.
Name Type Description index
Number Index Returns:
visibleThrows:
-
DeveloperError : the index is 0~3
-
-
Remove all target points.
Example:
var sightline = new SuperMap3D.Sightline(scene); sightline.removeAllTargetPoint();
-
Removes the target point with the specified name.
Name Type Description name
String The name of the target point to be removed. Returns:
Returns true if the removal is successful, otherwise returns false.Example:
var sightline = new SuperMap3D.Sightline(scene); var flag = sightline.removeTargetPoint(“first”);
-
Sets the layer corresponding viewport visibility.
Name Type Description index
Number Index Throws:
-
DeveloperError : the index is 0~3
-