Class

PrimitiveLayer

PrimitiveLayer(id)

Constructor

# new PrimitiveLayer(id)

Primitive图层

Parameters:
Name Type Description
id String

唯一id

Author:
  • xyj

Extends

Members

# attr

Overrides:
Array.<Cesium.BillboardCollection>

# readonly billboards

广告牌实体的集合

Array.<Cesium.CloudCollection>

# readonly clouds

.Cloud实体的集合

string

# readonly id

唯一标识

Overrides:
Array.<Cesium.LabelCollection>

# readonly labels

文字实体的集合

Layer

# readonly layer

图层

Overrides:
LayerEvent

# readonly layerEvent

图层事件

Overrides:
string

# readonly layerId

图层id

Overrides:
Array.<Cesium.PointPrimitiveCollection>

# readonly points

点的实体集合

Array.<Cesium.PolylineCollection>

# readonly polylines

线实体的集合

# show

Overrides:
string

# readonly state

状态

Overrides:
string

# readonly type

图形类型

Methods

# addGraphic(graphic) → {Layer}

添加实体

Parameters:
Name Type Description
graphic Graphic

实体

Overrides:
  • 当前对象
Layer

# addGraphics(graphics) → {Layer}

批量添加实体

Parameters:
Name Type Description
graphics Array.<Graphic>

实体数组

Overrides:
  • 当前对象
Layer

# addTo(viewer) → {Layer}

把当前图层添加至场景

Parameters:
Name Type Description
viewer Viewer

场景对象

Overrides:
  • 当前对象
Layer

# clear() → {PrimitiveLayer}

清除图层

# eachGraphic(method, context) → {Layer}

遍历实体

Parameters:
Name Type Description
method function

回调

context Context

上下文

Overrides:
  • 当前对象
Layer

# fire(type, params) → {Layer}

事件执行

Parameters:
Name Type Description
type String

事件类型

params Object | String

事件携带参数

Overrides:
  • 当前对象
Layer

# getGraphic(graphicId) → {Graphic}

根据id获取实体

Parameters:
Name Type Description
graphicId string

实体id

Overrides:
  • 实体对象
Graphic

# getGraphicById(graphicId) → {Graphic}

根据id获取实体

Parameters:
Name Type Description
graphicId string

实体id

Overrides:
  • 实体对象
Graphic

# getGraphics() → {Array.<Graphic>}

获取当前图层所有实体对象

Overrides:
  • 实体数组
Array.<Graphic>

# getGraphicsByAttr(attrName, attrVal) → {Array.<Graphic>}

根据属性获取实体

Parameters:
Name Type Description
attrName string

属性名字

attrVal string

属性值

Overrides:
  • 实体
Array.<Graphic>

# off(type, callback, context) → {Layer}

事件取消

Parameters:
Name Type Description
type String

事件类型

callback function

回调

context Context

上下文

Overrides:
  • 当前对象
Layer

# on(type, callback, context) → {Layer}

事件

Parameters:
Name Type Description
type String

事件类型

callback function

回调

context Context

上下文

Overrides:
  • 当前对象
Layer

# remove()

移出当前图层

Overrides:

# removeGraphic(graphic) → {Layer}

移出实体对象

Parameters:
Name Type Description
graphic Graphic

实体对象

Overrides:
  • 当前对象
Layer