Popup Class
信息窗体
Index
Methods
remove
()删除指定的信息窗体
Example:
var popup = new minemap.Popup().addTo(map);
popup.remove();
Returns:
Popup
this
setLngLat
(lnglat)设置信息窗体的经纬度锚点,并移动到指定的位置。
Parameters:
-
lnglat
LngLatLike
The geographical location to set as the popup's anchor.
Returns:
Popup
this
setText
(text)Example:
var popup = new minemap.Popup()
.setLngLat([116.4110, 39.9160])
.setText('Hello, world!')
.addTo(map);
Parameters:
-
text
String
信息窗体内容文字。
Returns:
Popup
this
setDOMContent
(htmlNode)用dom元素设置信息窗体的内容。
Example:
var div = document.createElement('div');
div.innerHTML = 'Hello, world!';
var popup = new minemap.Popup()
.setLngLat([116.4110, 39.9160])
.setDOMContent(div)
.addTo(map);
Parameters:
-
htmlNode
Node
作为信息窗体的内容的dom元素
Returns:
Popup
this
Properties
Events
close
当信息窗体关闭时触发
Parameters:
-
data
Object