Skyline

new Cesium.Skyline(scene)

Skyline analysis. The observer position, viewing direction, and analysis results 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 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 ;

displayMode : Number

Gets or sets the display mode of lines and faces.

displayStyle : Number

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 ;

pitch : Number

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;

radius : Number

Gets or sets the skyline analysis radius in meters. The default 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 observer's position
skyline.viewPosition   = [120, 40, 100];
//Get the observer's location
var value= skyline.viewPosition;

Methods

addLimitbody(options)Boolean

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.

build()

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

clear()

Clear the height limit.

getObjectIds()Object

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.

getSkyline2D()Object

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

getSkyline3D()Object

Output 3D skyline analysis results.
Returns:
A three-dimensional line, represented by an array of x/y/z.

getSkylineSectorParameter()Object

Get the construction parameters of the skyline closure, including the 3D skyline and the viewpoint location.
Returns:

getVisibleInViewport(index)Boolean

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

removeAllLimitBody()

Remove the limited high object.

removeLimitbody(name)Boolean

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.

setVisibleInViewport(index)

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