Skyline Analysis. The position of the observer and the direction of observation can be set, and the analysis results can be obtained in the scene.
Name | Type | Description |
---|---|---|
scene |
Object | optional |
Throws:
-
DeveloperError : The scene scene must be specified.
Example:
//create skyline analysis
var skyline= new SuperMap3D.Skyline(scene);
Demo:
Members
-
color : Color
-
Get or Set the color
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 ;
-
Get or set the angle between the camera and true north. Unit: degree, value range 0-360.
Example:
var skyline= new SuperMap3D.Skyline(scene); // set direction skyline.direction = 1.0; //get direction var value= skyline.direction ;
-
Get or set the display mode of lines and areas. When the value is 0, it is displayed as a line; when the value is 1, it is displayed as a surface. The default is line.
-
Default Value:
0
-
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 SuperMap3D.Skyline(scene); //Set the display mode skyline.displayStyle = SuperMap3D.Skyline.displayMode.LINE; // get display mode var value= skyline.displayStyle ;
-
Whether the earth's surface participates in the skyline analysis, the default value is false, which means participating, and when set to true, it means not participating.
-
Set the width of the skyline, the default is 1 pixel.
-
Default Value:
1
-
Get or set 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 SuperMap3D.Skyline(scene); //Set pitch angle skyline. pitch = 1.0; //Get pitch angle var value= skyline.pitch;
-
Get or set the skyline analysis radius, unit: meter. The default is -1.0, which means infinity.
-
Default Value:
-1.0
-
Get or Set the viewPosition
Example:
var skyline= new SuperMap3D.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 limit volume objects for skyline analysis, simulating the height range of new buildings without affecting the skyline.
Name Type Description options
Object Objects have the following properties: Name Type Description position
Array Specify the location information of the height limit body, represented by an array of longitude and latitude name
String Specifies the height limit body name. Returns:
Returns true if the addition is successful, and returns false if it fails. -
Perform skyline analysis.
Example:
var skyline= new SuperMap3D.Skyline(scene); skyline.bulid();
-
Clear the skyline and height limit objects in the current scene.
-
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 the 2D skyline analysis results.
Returns:
A 2D line, represented by an x/y array. -
Output 3D skyline analysis results.
Returns:
A 3D line, represented by an x/y/z array. -
Obtain the construction parameters of the skyline closure, including the 3D skyline and the position of the observation point.
Returns:
-
Gets the visibility of skyline analysis results in the specified viewport.
Name Type Description index
Number The specified viewport index. Returns:
visibilityThrows:
-
DeveloperError : index value range from 0-3。
-
-
Removes all height bound objects.
-
Remove the height limit object with the specified name.
Name Type Description name
String The name of the height limit body to be removed. Returns:
If the removal is successful, return true, and if it fails, return false. -
Sets the visibility of skyline analysis results in the specified viewport.
Name Type Description index
Number Sets the visibility of skyline analysis results in the specified viewport. Throws:
-
DeveloperError : index value range from 0-3。
-