PointLayer

图形点图层

new YS.PointLayer(options, global)

图形点图层, 只带颜色和大小的小圆点
Name Type Description
options Object 对象有下面这些属性:
Name Type Default Description
id String optional 唯一标识
name String optional 名称
category String optional 图层分组
visible Boolean true optional 是否可见
isAddTree Boolean true optional 是否添加到图层树上
treeIcon String optional 图层树上显示的图标,默认不显示
blendOption Boolean BlendOption.OPAQUE_AND_TRANSLUCENT optional 图形点的混合选项,如果图形点全是透明或者半透明的,设置这个对应的选项可以使性能提高
closeDepth Boolean true optional 是否关闭深度检测
closeDepthDistance Boolean optional 指定相机距离多远禁用深度检测(开启深度检测时才有效)
global Object 三维球对象(YouScene.earth)
Implements:
Example:
var pointLayer = youScene.layers.addPointLayer({
                 id: 'pointLayer',
                 name: 'pointLayer',
             });
Demo:

Members

count : Number

获取圆点的数量

visible : Boolean

获取或设置是否可见

Methods

add(point)Point

添加图标
Name Type Description
point Point 对象
Fires:
  • PointLayer#event:featureAdded
Returns:
point 对象

clear()

清空Point

destroy()

销毁
Implements:

getById(id)Feature

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

remove(point)Boolean

移除图标
Name Type Description
point Point 对象
Returns:
删除成功返回true, 删除失败返回false

removeById(id)Boolean

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

Events

click

圆点点击事件(如果子类icon的click被调用,那么则相应子类的click事件)
Implements:

mouseHover

鼠标覆盖事件(如果子类icon的mouseHover被调用,那么则相应子类的mouseHover事件)
Implements:

mouseOut

鼠标移出事件(如果子类icon的mouseOut被调用,那么则相应子类的mouseOut事件)
Implements: