Skyline analysis. The observer's position and viewing direction can be set, and the analytical result can be obtained in the scene.
Name | Type | Description |
---|---|---|
scene |
Object | optional |
Throws:
-
DeveloperError : The 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 true north. Unit: degrees, the value range is 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 the line and area. When the value is 0, it is displayed as a line; when the value is 1, it is displayed as a surface. The default value is line.
-
Default Value:
0
-
Gets or sets the display mode of the skyline. DisplayMode.LINE represents the line mode of the skyline, and DisplayMode.FACE represents the surface mode of the skyline.
Example:
var skyline= new Cesium.Skyline(scene); //Set the display mode skyline.displayStyle = Cesium.Skyline.displayMode.LINE; //Get display mode var value= skyline.displayStyle ;
-
Whether the surface of the earth participates in the skyline analysis, the default value is false to indicate participation, when set to true, it means not to participate.
-
Set the width of the skyline, the default is 1 pixel.
-
Default Value:
1
-
Gets or sets the pitch angle of the camera, which is the angle between the camera direction and the water surface direction. Unit: Degree, the value range is 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 analysis radius of the skyline, in meters. The default value is -1.0, which means infinity.
-
Default Value:
-1.0
-
Get or Set the viewPosition
Example:
var skyline= new Cesium.Skyline(scene); //Set the position of the observer skyline.viewPosition = [120, 40, 100]; //Get the position of the observer var value= skyline.viewPosition;
Methods
-
Add height-limiting objects to the skyline analysis to simulate the height range of newly-built buildings without affecting the skyline.
Name Type Description options
Object The object has the following attributes: Name Type Description position
Array The location information of the specified height-limiting body is represented by an array of longitude and latitude. name
String Specify the name of the height-limiting body. Returns:
It returns true if successful, false if it fails. -
Perform a skyline analysis.
Example:
var skyline= new Cesium.Skyline(scene); skyline.bulid();
-
Clear the height-limiting body.
-
Get the IDS collection of obstacle objects.
Returns:
Return 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 2D line, represented by an x/y array. -
Output 3D skyline analysis results.
Returns:
The 3D line is represented by the x/y/z array. -
Obtain the construction parameters of the closed skyline volume, including the 3D skyline and the position of the observation point.
Returns:
-
Get the visibility of the skyline analysis result in the specified viewport.
Name Type Description index
Number The specified viewport index. Returns:
Visibility.Throws:
-
DeveloperError : The range of index value is 0-3.
-
-
Remove all limited high body objects.
-
Remove the height-limiting object with the specified name.
Name Type Description name
String The name of the height-limiting body to be removed. Returns:
Return true if the removal is successful, false if it fails. -
Set the visibility of the skyline analysis result in the specified viewport.
Name Type Description index
Number The specified viewport index. Throws:
-
DeveloperError : The range of index value is: 0-3.
-