Class: Skyline

Skyline

new Skyline()

Skyline analysis. Observer position and observation direction can be set, and analysis results can be obtained in the scene.

Demo:
Throws:

Scene must be specified.

Type
DeveloperError
Example
// Create skyline analysis
var skyline= new SuperMap3D.Skyline(scene);

Members

colorColor

Get or set the color.

Default Value:
SuperMap3D.Color(1.0, 0.0, 0.0, 1.0)
Example
var skyline= new SuperMap3D.Skyline(scene);
var color = new SuperMap3D.Color(0, 1, 0);
 // Set color
 skyline.color = color;
 // Get color
 var value= skyline.color ;

directionnumber

Get or set the angle between the camera and the true north direction. Unit: degree, with a value range of 0-360.

Default Value:
0.0
Example
var skyline= new SuperMap3D.Skyline(scene);
// Set direction
skyline.direction = 1.0;
// Get direction
var value= skyline.direction ;

displayModenumber

Get or set the display mode of lines and surfaces. When the value is set to 0, it is displayed in the form of a line; When the value is 1, it is displayed as a face. The default value is line.

Default Value:
0

displayStylenumber

Get or set the display mode of the skyline. Display Mode. LINE represents the line mode of the skyline, while Display Mode. FACE represents the surface mode of the skyline.

Default Value:
DisplayMode
Example
var skyline= new SuperMap3D.Skyline(scene);
// Set the display mode
skyline.displayStyle = SuperMap3D.Skyline.displayMode.LINE;
// Get the display mode
var value= skyline.displayStyle ;

ignoreGlobeboolean

Whether the Earth's surface participates in skyline analysis, the default value is false to indicate participation, and when set to true, it indicates non participation.

Default Value:
false

lineWidthnumber

Set the width of the skyline to 1 pixel by default.

Default Value:
1

pitchnumber

Get or set the camera's pitch angle, which is the angle between the camera direction and the water surface direction. Unit: degree, with a value range of 0-90.

Default Value:
0.0
Example
var skyline= new SuperMap3D.Skyline(scene);
// Set pitch angle
skyline.pitch = 1.0;
// Get pitch angle
var value= skyline.pitch;

radiusnumber

Get or set the skyline analysis radius in meters. The default value is -1.0, indicating infinity.

Default Value:
-1.0

viewPositionArray

Get or set the view position.

Default Value:
[0.0,0.0,0.0]
Example
var skyline= new SuperMap3D.Skyline(scene);
// Set the observer's position
skyline.viewPosition   = [120, 40, 100];
// Get the observer's position
var value= skyline.viewPosition;

Methods

addLimitbody(){boolean}

Add height limiting objects to skyline analysis to simulate the height range of newly constructed buildings without affecting the skyline.

Name Type Description
options.position Array

Specify the position information of the height limit body, represented by an array of longitude and latitude.

options.name string

Specify the height limit body name.

Returns:
Type Description
boolean Add successfully returns true, fail returns false.

build()

Perform skyline analysis.

Example
var skyline= new SuperMap3D.Skyline(scene);
skyline.bulid();

clear()

Clear the skyline and height limiting objects in the current scene.

destroy()

Destruction of resources held by skyline objects

getObjectIds(){Object}

Obtain the IDS collection of obstacle objects.

Returns:
Type Description
Object Return a k-v object with key as S3M layer ID and value as object IDS array.

getObjectIdsAsync(){Object}

Asynchronous acquisition of obstacle object IDS collection

Returns:
Type Description
Object Return a k-v object with key as S3M layer ID and value as object ids array. Suitable for WebGPU and WebGL

getSkyline2D(){Object}

Output two-dimensional skyline analysis results.

Returns:
Type Description
Object A two-dimensional line represented by an x/y array.

getSkyline2DAsync(){Object}

Asynchronous output of 2D skyline, suitable for WebGPU and WebGL

Returns:
Type Description
Object 2D line xy

getSkyline3D(){Object}

Output the three-dimensional skyline analysis results.

Returns:
Type Description
Object Three dimensional lines, represented by x/y/z arrays.

getSkylineSectorParameter(){Object}

Obtain the construction parameters of the skyline closure, including the 3D skyline and observation point positions.

Returns:
Type Description
Object

getVisibleInViewport(index){boolean}

Obtain the visibility of skyline analysis results in the specified viewport.

Name Type Description
index number

The specified viewport index.

Throws:

The range of index values is 0-8.

Type
DeveloperError
Returns:
Type Description
boolean Visibility.

removeAllLimitBody()

Remove the limited height object.

removeLimitbody(name){boolean}

Remove the height limited object with the specified name.

Name Type Description
name string

The name of the height limiting body to be removed.

Returns:
Type Description
boolean Return true for successful removal and false for failure.

setVisibleInViewport(index)

Set the visibility of skyline analysis results in the specified viewport.

Name Type Description
index number

The specified viewport index.

Throws:

The range of index values is 0-8.

Type
DeveloperError