PolygonLayer

多边形图层

new YS.PolygonLayer(options, global)

多边形图层
Name Type Description
options Object 对象有下面这些属性:
Name Type Description
id String optional 唯一标识
name String optional 名称
isAddTree Boolean optional 是否加入树
treeIcon String optional 图层树上显示的图标,默认不显示
category String optional 图层分组
visible Boolean optional 是否可见
global Object 三维球对象(YouScene.earth)
Implements:
Example:
var layer = youScene.layers.addPolygonLayer({
          id:'123',
          name:'213',
      });
Demo:

Members

count : Number

获取几何面的数量

visible : Boolean

获取或设置是否可见

Methods

add(polygon)Polygon

在图层中添加polygon(贴地面不支持画外边框)
Name Type Description
polygon Polygon 几何面数据
Returns:
添加的几何面数据

clear()

清空polygons

destroy()

销毁polygonLayer
Implements:

getById(id)Feature

根据id获取图层内对象
Name Type Description
id String 对象的id
Returns:
返回查找到的对象,找不到返回undefined
Implements:

getByIndex(index)Feature

根据索引获取图层内对象
Name Type Description
index Number 对象的索引号,[0, count)
Returns:
返回查找到的对象,找不到返回undefined
Implements:

remove(polygon)Boolean

移除几何面
Name Type Description
polygon Polygon 对象
Returns:

removeById(id)Boolean

通过id移除面
Name Type Description
id String 唯一标识符
Returns: