Popup~Popup(options, attribute)

Summary

Methods:
clone

克隆一个Popup,返回新实例

getAttributes

返回自定义属性

getElement

获取Popup的元素

getId

获取唯一标志

getLocation

获取坐标位置

getOffset

获取偏移量

getType

获取类型

getVisibility

获取是否显示

setAttributes

设置自定义属性

setElement

重新设置叠加物中的DOM内容

setLocation

修改坐标位置

setOffset

设置InfoWindow的偏移值

setVisibility

设置是否显示

Constructor

Parameters:
Name Type Description
options Object

操作配置项

Name Type Description
location Array.<Number>

球体经纬度坐标

element HTMLElement | String

popup里面的显示文本

offset Array.<Number>

指定偏移位置 默认[0,0]

visible Boolean

控制叠加物的显示隐藏。

attribute Object

自定义属性

Throws:

当 location 没有传入值的时候抛出异常

Methods

clone() → {Popup}

克隆一个Popup,返回新实例

Returns:
Popup

getAttributes() → {Object}

返回自定义属性

Returns:
Object

getElement() → {HTMLDocument}

获取Popup的元素

Returns:
HTMLDocument

getId() → {String}

获取唯一标志

Returns:
String

getLocation() → {Array.<Number>}

获取坐标位置

Returns:
Array.<Number>

getOffset() → {Array.<Number>}

获取偏移量

Returns:
Array.<Number>

getType() → {String}

获取类型

Returns:
String

getVisibility() → {Boolean}

获取是否显示

Returns:
Boolean

setAttributes(attr)

设置自定义属性

Parameters:
Name Type Description
attr Object

setElement(element)

重新设置叠加物中的DOM内容

Parameters:
Name Type Description
element HTMLElement | String

dom对象或dom字符串

setLocation(coord)

修改坐标位置

Parameters:
Name Type Description
coord Array.<Number>

坐标

Throws:

传入的参数不是数组的时候抛出异常

setOffset(offset)

设置InfoWindow的偏移值

Parameters:
Name Type Description
offset Array.<Number>

偏移值 [x,y]

Throws:

当offset参数为空或者长度不等于二的时候抛出异常

setVisibility(visible)

设置是否显示

Parameters:
Name Type Description
visible Boolean