Class: Skyline

Skyline

new Skyline()

天际线分析。可设定观察者位置、观察方向,并在场景中得到分析结果。

Demo:
Throws:

必须指定场景scene。

Type
DeveloperError
Example
//创建天际线分析
var skyline= new SuperMap3D.Skyline(scene);

Members

colorColor

获取或设置颜色。

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);
 //设置颜色
 skyline.color = color;
 //获取颜色
 var value= skyline.color ;

directionnumber

获取或设置相机与正北方向的夹角。单位:度,取值范围0-360。

Default Value:
0.0
Example
var skyline= new SuperMap3D.Skyline(scene);
//设置方向
skyline.direction = 1.0;
//获取方向
var value= skyline.direction ;

displayModenumber

获取或设置线、面的显示模式。当值取0时,以线的形式展示;当值为1时,以面展示。默认值为线。

Default Value:
0

displayStylenumber

获取或设置天际线的显示模式。 DisplayMode.LINE表示天际线的线模式,DisplayMode.FACE表示天际线的面模式。

Default Value:
DisplayMode
Example
var skyline= new SuperMap3D.Skyline(scene);
//设置显示模式
skyline.displayStyle = SuperMap3D.Skyline.displayMode.LINE;
//获取显示模式
var value= skyline.displayStyle ;

ignoreGlobeboolean

地球表面是否参与天际线分析,默认值为false表示参与,当设置为true则表示不参与。

Default Value:
false

lineWidthnumber

设置天际线的宽度,默认1像素。

Default Value:
1

pitchnumber

获取或设置相机的俯仰角,该俯仰角为相机方向和水面方向的夹角。单位:度,取值范围为0-90 。

Default Value:
0.0
Example
var skyline= new SuperMap3D.Skyline(scene);
//设置俯仰角
skyline.pitch = 1.0;
//获取俯仰角
var value= skyline.pitch;

radiusnumber

获取或设置天际线分析半径,单位:米。默认值为-1.0,表示无穷远。

Default Value:
-1.0

viewPositionArray

获取或设置视图位置。

Default Value:
[0.0,0.0,0.0]
Example
var skyline= new SuperMap3D.Skyline(scene);
//设置观察者的位置
skyline.viewPosition   = [120, 40, 100];
//获取观察者的位置
var value= skyline.viewPosition;

Methods

addLimitbody(){boolean}

为天际线分析添加限高体对象,模拟新建建筑物在不影响天际线时的高度范围。

Name Type Description
options.position Array

指定限高体位置信息,由经度、纬度的数组表示。

options.name string

指定限高体名称。

Returns:
Type Description
boolean 添加成功返回true,失败返回false。

build()

执行天际线分析。

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

clear()

清除当前场景中的天际线及限高体对象。

destroy()

销毁天际线对象持有的资源

getObjectIds(){Object}

获取障碍物对象的IDS集合。

Returns:
Type Description
Object 返回一个k-v对象,key为S3M图层ID,value为对象IDS数组。

getObjectIdsAsync(){Object}

异步获取障碍物对象IDS集合

Returns:
Type Description
Object 返回一个k-v对象,key为S3M图层ID,value为对象ids数组。适用于webgpu和webgl

getSkyline2D(){Object}

输出二维的天际线分析结果。

Returns:
Type Description
Object 二维线,由x/y数组表示。

getSkyline2DAsync(){Object}

异步获取获得二维天际线,适用于webgpu和webgl

Returns:
Type Description
Object 二维线xy

getSkyline3D(){Object}

输出三维的天际线分析结果。

Returns:
Type Description
Object 三维线,由x/y/z数组表示。

getSkylineSectorParameter(){Object}

获取天际线闭合体的构建参数,包括三维天际线、观察点位置。

Returns:
Type Description
Object

getVisibleInViewport(index){boolean}

获取天际线分析结果在指定视口的可见性。

Name Type Description
index number

指定的视口索引。

Throws:

索引值的范围为0-8。

Type
DeveloperError
Returns:
Type Description
boolean 可见性。

removeAllLimitBody()

移除所有限高体对象。

removeLimitbody(name){boolean}

移除指定名称的限高体对象。

Name Type Description
name string

待移除限高体的名称。

Returns:
Type Description
boolean 移除成功返回true,失败返回false。

setVisibleInViewport(index)

设置天际线分析结果在指定视口的可见性。

Name Type Description
index number

指定的视口索引。

Throws:

索引值的范围为:0-8。

Type
DeveloperError