Skyline

new Cesium.Skyline(scene)

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:
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 ;

direction : Number

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 ;

displayMode : Number

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

displayStyle : Number

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 ;

ignoreGlobe : Boolean

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.

lineWidth : Number

Set the width of the skyline, the default is 1 pixel.
Default Value: 1

pitch : Number

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;

radius : Number

Gets or sets the analysis radius of the skyline, in meters. The default value is -1.0, which means infinity.
Default Value: -1.0

viewPosition : Array

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

addLimitbody(options)Boolean

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.

build()

Perform a skyline analysis.
Example:
var skyline= new Cesium.Skyline(scene);
skyline.bulid();

clear()

Clear the height-limiting body.

getObjectIds()Object

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.

getSkyline2D()Object

Output 2D skyline analysis results.
Returns:
A 2D line, represented by an x/y array.

getSkyline3D()Object

Output 3D skyline analysis results.
Returns:
The 3D line is represented by the x/y/z array.

getSkylineSectorParameter()Object

Obtain the construction parameters of the closed skyline volume, including the 3D skyline and the position of the observation point.
Returns:

getVisibleInViewport(index)Boolean

Get the visibility of the skyline analysis result in the specified viewport.
Name Type Description
index Number The specified viewport index.
Returns:
Visibility.
Throws:

removeAllLimitBody()

Remove all limited high body objects.

removeLimitbody(name)Boolean

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.

setVisibleInViewport(index)

Set the visibility of the skyline analysis result in the specified viewport.
Name Type Description
index Number The specified viewport index.
Throws: