Class: Graphic

Graphic()

new Graphic()

Source:

Methods

(async, static) createObj() → {Promise.<Graphic>}

构造一个新的 Graphic 对象。
Source:
Returns:
Type
Promise.<Graphic>

(async, static) getAttributeName(index) → {Promise.<String>}

根据索引获取图形属性名
Parameters:
Name Type Description
index Number 索引
Source:
Returns:
Type
Promise.<String>

(async, static) getAttributeNum() → {Promise.<Number>}

获取图形属性的数目
Source:
Returns:
Type
Promise.<Number>

(async, static) getAttributeValueByIndex(index) → {Promise.<String>}

根据索引获取图形属性值
Parameters:
Name Type Description
index Number 图形属性的索引,从0开始到属性数目减1
Source:
Returns:
Type
Promise.<String>

(async, static) getAttributeValueByName(name) → {Promise.<String>}

根据属性名称获取图形属性值
Parameters:
Name Type Description
name String 属性名称
Source:
Returns:
Type
Promise.<String>

(async, static) getBoundingRect() → {Promise.<Rect>}

获取图形外包矩形
Source:
Returns:
Type
Promise.<Rect>

(async, static) getCenterPoint() → {Promise.<Dot>}

获取图形中心点坐标
Source:
Returns:
Type
Promise.<Dot>

(async, static) getColor() → {Promise.<String>}

获取图形的颜色
Source:
Returns:
图形颜色 eg:'rgba(128, 128, 128, 255)'
Type
Promise.<String>

(async, static) getGraphicType() → {Promise.<Number>}

获取图形类型
Source:
Returns:
图形类型。例:1---GraphicType.PointType
Type
Promise.<Number>

(async, static) getState() → {Number}

获取覆盖物的可见状态
Source:
Returns:
返回层的状态 0 不可见 1 可见
Type
Number

(async, static) isPointByPixel() → {Promise.<boolean>}

获取点是否为像素单位
Source:
Returns:
Type
Promise.<boolean>

(static) isValid() → {boolean}

判断Graphic对象是否有效
Source:
Returns:
是否有效。true: 有效;false:无效
Type
boolean

(async, static) removeAllAttributes() → {Promise.<void>}

移除所有属性.
Source:
Returns:
Type
Promise.<void>

(async, static) removeAttribute(name) → {Promise.<void>}

移除指定名称的属性
Parameters:
Name Type Description
name String 属性名称
Source:
Returns:
Type
Promise.<void>

(async, static) setAttributeValue(name, value) → {Promise.<void>}

设置图形的属性
Parameters:
Name Type Description
name String 属性名称
value String 属性值
Source:
Returns:
Type
Promise.<void>

(async, static) setColor(color) → {Promise.<Void>}

设置图形颜色
Parameters:
Name Type Description
color String 图形颜色 eg:'rgba(128, 128, 128, 255)'
Source:
Returns:
Type
Promise.<Void>

(async, static) setPointByPixel(pixel) → {Promise.<void>}

设置点是否为像素单位(默认情况下为地图单位)
Parameters:
Name Type Description
pixel boolean 点是否为像素单位
Source:
Returns:
Type
Promise.<void>

(async, static) setState(state) → {Promise.<Void>}

设置覆盖物的可见状态
Parameters:
Name Type Description
state Number 覆盖物的可见状态。0 不可见;1 可见
Source:
Returns:
Type
Promise.<Void>