LinesLayer

线图层

new YS.LinesLayer(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.addLinesLayer({
          id:'123',
          name:'213',
      });
Demo:

Members

count : Number

获取线的数量

visible : Boolean

获取或设置是否可见

Methods

add(line)Line

添加线到图层
Name Type Description
line Line Line
Returns:
返回添加的线对象
To Do:
  • 功能存在缺陷

clear()

清空lines

destroy()

销毁lineslayer
Implements:

getById(id)Object

通过ID查询线
Name Type Description
id String 线唯一的标识符
Returns:
返回 line 对象
Implements:

getByIndex(index)Object

通过索引查询线
Name Type Description
index String 线图层索引
Returns:
返回 line 对象
Implements:

getIndex(id)Nubber

通过ID查询线的索引
Name Type Description
id String 线唯一的标识符
Returns:
查得到返回索引,查不到返回-1

remove(line)

移除线
Name Type Description
line Object 对象

removeById(id)Boolean

通过id移除线
Name Type Description
id String 唯一标识符
Returns:
移除成功返回true, 失败返回false