Members
Methods
# addGraphics(graphics) → {Layer}
批量添加实体
Parameters:
| Name | Type | Description |
|---|---|---|
graphics |
Array.<Graphic>
|
实体数组 |
- 当前对象
# eachGraphic(method, context) → {Layer}
遍历实体
Parameters:
| Name | Type | Description |
|---|---|---|
method |
function
|
回调 |
context |
Context
|
上下文 |
- 当前对象
# fire(type, params) → {Layer}
事件执行
Parameters:
| Name | Type | Description |
|---|---|---|
type |
String
|
事件类型 |
params |
Object
|
String
|
事件携带参数 |
- 当前对象
# getGraphic(graphicId) → {Graphic}
根据id获取实体
Parameters:
| Name | Type | Description |
|---|---|---|
graphicId |
string
|
实体id |
- 实体对象
# getGraphicById(graphicId) → {Graphic}
根据id获取实体
Parameters:
| Name | Type | Description |
|---|---|---|
graphicId |
string
|
实体id |
- 实体对象
# getGraphicsByAttr(attrName, attrVal) → {Array.<Graphic>}
根据属性获取实体
Parameters:
| Name | Type | Description |
|---|---|---|
attrName |
string
|
属性名字 |
attrVal |
string
|
属性值 |
- 实体
Array.<Graphic>
# off(type, callback, context) → {Layer}
事件取消
Parameters:
| Name | Type | Description |
|---|---|---|
type |
String
|
事件类型 |
callback |
function
|
回调 |
context |
Context
|
上下文 |
- 当前对象
# on(type, callback, context) → {Layer}
事件
Parameters:
| Name | Type | Description |
|---|---|---|
type |
String
|
事件类型 |
callback |
function
|
回调 |
context |
Context
|
上下文 |
- 当前对象