new GraphicsOverlay()
- Source:
Methods
(async, static) addGraphic(graphic) → {Number}
添加一个图形
Parameters:
| Name | Type | Description |
|---|---|---|
graphic |
Graphic |
- Source:
Returns:
成功返回 1 ,失败返回0
- Type
- Number
(async, static) addGraphics(graphicArray) → {Promise.<void>}
添加一组图形
Parameters:
| Name | Type | Description |
|---|---|---|
graphicArray |
Array.<Graphic> |
- Source:
Returns:
- Type
- Promise.<void>
(async, static) createObj() → {Promise.<GraphicsOverlay>}
构造一个新的 GraphicsOverlay 对象。
- Source:
Returns:
- Type
- Promise.<GraphicsOverlay>
(async, static) getAllGraphics() → {Promise.<Array.<Graphic>>}
返回所有图形
- Source:
Returns:
- Type
- Promise.<Array.<Graphic>>
(async, static) getGraphic(index) → {Promise.<Graphic>}
获取指定索引的图形
Parameters:
| Name | Type | Description |
|---|---|---|
index |
Number | 索引 |
- Source:
Returns:
- Type
- Promise.<Graphic>
(async, static) getGraphicCount() → {Promise.<Number>}
返回所有图形的数目
- Source:
Returns:
- Type
- Promise.<Number>
(async, static) getGraphicsByAttribute(name, value) → {Promise.<Array.<Graphic>>}
获取指定属性的图形
Parameters:
| Name | Type | Description |
|---|---|---|
name |
String | 属性名 |
value |
String | 属性值 |
- Source:
Returns:
- Type
- Promise.<Array.<Graphic>>
(async, static) getName() → {Promise.<String>}
获取层名称
- Source:
Returns:
- Type
- Promise.<String>
(async, static) getState() → {Number}
获取图形层的可见状态
- Source:
Returns:
返回层的状态 0--不可见; 1--可见
- Type
- Number
(async, static) indexOf(graphic) → {Promise.<Number>}
获取指定图形的索引
Parameters:
| Name | Type | Description |
|---|---|---|
graphic |
Graphic | 图形对象 |
- Source:
Returns:
图形索引
- Type
- Promise.<Number>
(async, static) insertGraphic(index, graphic) → {Promise.<Number>}
插入图形
Parameters:
| Name | Type | Description |
|---|---|---|
index |
Number | 要插入的位置 |
graphic |
Graphic | 要插入的图形 |
- Source:
Returns:
returnID > 0 插入成功,returnID < 0 插入失败
- Type
- Promise.<Number>
(static) isValid() → {Boolean}
判断graphicsOverlay是否有效
- Source:
Returns:
true - 有效;false - 无效
- Type
- Boolean
(async, static) moveGraphic(fromIndex, toIndex) → {Promise.<Void>}
移动图形的叠放次序
Parameters:
| Name | Type | Description |
|---|---|---|
fromIndex |
Number | 移动源索引 (int范围的Number) |
toIndex |
Number | 移动目的索引 (int范围的Number) |
- Source:
Returns:
- Type
- Promise.<Void>
(async, static) removeAllGraphics()
删除所有图形
- Source:
(async, static) removeGraphic(graphic) → {Promise.<void>}
删除一个图形
Parameters:
| Name | Type | Description |
|---|---|---|
graphic |
Graphic |
- Source:
Returns:
- Type
- Promise.<void>
(async, static) removeGraphicByAttribute(name, value) → {Promise.<Void>}
删除指定属性的图形
Parameters:
| Name | Type | Description |
|---|---|---|
name |
String | 属性名 |
value |
String | 属性值 |
- Source:
Returns:
- Type
- Promise.<Void>
(async, static) removeGraphicByIndex(index) → {Promise.<Void>}
删除指定索引的图形
Parameters:
| Name | Type | Description |
|---|---|---|
index |
Number | 索引 |
- Source:
Returns:
- Type
- Promise.<Void>
(async, static) removeGraphics(graphicArray) → {Promise.<void>}
删除一组图形
Parameters:
| Name | Type | Description |
|---|---|---|
graphicArray |
Array.<Graphic> |
- Source:
Returns:
- Type
- Promise.<void>
(async, static) setName(name) → {Promise.<void>}
设置层名称
Parameters:
| Name | Type | Description |
|---|---|---|
name |
String |
- Source:
Returns:
- Type
- Promise.<void>
(async, static) setState(state) → {Promise.<Void>}
设置图形层的可见状态
Parameters:
| Name | Type | Description |
|---|---|---|
state |
Number | 层的状态 0--不可见; 1--可见 |
- Source:
Returns:
- Type
- Promise.<Void>