Line-of-sight analysis, that is, line-of-sight analysis, establishes line-of-sight analysis based on the observer's point and target point, and analyzes the result in the scene.
Name | Type | Description |
---|---|---|
scene |
Scene | Scene object. |
Throws:
-
DeveloperError : Specify the scene.
Example:
//Sightline
var sightline = new Cesium.Sightline(scene);
Demo:
Members
-
hiddenColor : Color
-
Gets or sets the color of the invisible part of the visibility analysis.
Example:
var sightline = new Cesium.Sightline(scene); var color = new Cesium.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 position of the observer. The location is represented by an array of longitude, latitude, and elevation.
Example:
var sightline = new Cesium.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
-
Gets or sets the color of the visible part of the visibility analysis.
Example:
var sightline = new Cesium.Sightline(scene); var color = new Cesium.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
Object The object has the following properties. Name Type Description position
Array Location information, represented by an array of longitude, latitude, and elevation. name
String The name of the target point. Returns:
Return true if added successfully, otherwise false.Example:
var sightline = new Cesium.Sightline(scene); sightline.addTargetPoint({ postion : [120, 40, 50], name : “first” });
-
Excute sightline analysis.
Example:
var sightline = new Cesium.Sightline(scene); sightline.build();
-
Obtain obstacle points.
Name Type Description name
String The name of the target point. func
Object Callback. Returns:
Object.isViewer, Object.position can see the latitude and longitude. -
Obtain the IDS collection of all obstacle objects for visibility analysis.
Returns:
Return a k-v object, the key is the S3M layer ID, and the value is the object IDS array. -
Obtain the visibility of the viewport corresponding to the layer.
Name Type Description index
Number Index. Returns:
Visibility (optional)Throws:
-
DeveloperError : the index is 0~3
-
-
Remove all target points.
Example:
var sightline = new Cesium.Sightline(scene); sightline.removeAllTargetPoint();
-
Remove the target point with the specified name.
Name Type Description name
String The name of the target point to be removed. Returns:
Return true if the removal is successful, otherwise false.Example:
var sightline = new Cesium.Sightline(scene); var flag = sightline.removeTargetPoint(“first”);
-
Set the visibility of the corresponding viewport of the layer.
Name Type Description index
Number Index. Throws:
-
DeveloperError : the index is 0~3
-