Skyline analysis. The observer position, viewing direction, and analysis results can be obtained in the scene.
Name | Type | Description |
---|---|---|
scene |
Object | optional |
Throws:
-
DeveloperError : Scene scene must be specified.
Example:
//Create a skyline analysis
var skyline= new Cesium.Skyline(scene);
Demo:
Members
-
color : Color
-
Get or Set the color
Example:
var skyline= new Cesium.Skyline(scene); var color = new Cesium.Color(0, 1, 0); //Set color skyline.color = color; //Get color var value= skyline.color ;
-
Gets or sets the angle between the camera and the north direction. Unit: degree, ranging from 0-360.
Example:
var skyline= new Cesium.Skyline(scene); //Set direction skyline.direction = 1.0; //Get directions var value= skyline.direction ;
-
Gets or sets the display mode of lines and faces.
-
Gets or sets the display mode of the skyline. DisplayMode.LINE indicates the line mode of the skyline, and DisplayMode.FACE indicates the face mode of the skyline.
Example:
var skyline= new Cesium.Skyline(scene); //Set display mode skyline.displayStyle = Cesium.Skyline.displayMode.LINE; //Get display mode var value= skyline.displayStyle ;
-
Gets or sets the camera's pitch angle, which is the angle between the camera's direction and the water's direction. Unit: degree, ranging from 0-90.
Example:
var skyline= new Cesium.Skyline(scene); //Set the pitch angle skyline.pitch = 1.0; //Get the pitch angle var value= skyline.pitch;
-
Gets or sets the skyline analysis radius in meters. The default is -1.0, which means infinity.
-
Default Value:
-1.0
-
Get or Set the viewPosition
Example:
var skyline= new Cesium.Skyline(scene); //Set the observer's position skyline.viewPosition = [120, 40, 100]; //Get the observer's location var value= skyline.viewPosition;
Methods
-
Add a height limit object to the skyline analysis to simulate the height range of the new building without affecting the skyline.
Name Type Description options
Object The object has the following properties: Name Type Description position
Array Specify the height limit position information, which is represented by an array of longitude and latitude. name
String Specify the height limit body name. Returns:
The success returns true, and the failure returns false. -
Perform a skyline analysis.
Example:
var skyline= new Cesium.Skyline(scene); skyline.bulid();
-
Clear the height limit.
-
Get the IDS collection of obstacle objects.
Returns:
Returns a k-v object, the key is the S3M layer ID, and the value is the object IDS array. -
Output 2D skyline analysis results.
Returns:
A two-dimensional line, represented by an x/y array. -
Output 3D skyline analysis results.
Returns:
A three-dimensional line, represented by an array of x/y/z. -
Get the construction parameters of the skyline closure, including the 3D skyline and the viewpoint location.
Returns:
-
Gets the visibility of the skyline analysis results in the specified viewport.
Name Type Description index
Number The specified viewport index. Returns:
Visibility.Throws:
-
DeveloperError : The index value ranges from 0-3.
-
-
Remove the limited high object.
-
Remove the height limit object of the specified name.
Name Type Description name
String The name of the height limit to be removed. Returns:
Returns true if the removal succeeds, false returns if it fails. -
Sets the visibility of the skyline analysis results in the specified viewport.
Name Type Description index
Number The specified viewport index. Throws:
-
DeveloperError : The range of index values is: 0-3.
-