new Popup(options)
标牌,使用时应该由视图创建, 请使用视图的 module:olview.View#createPopup 方法
Parameters:
Name | Type | Description |
---|---|---|
options |
Object |
Methods
-
bind(cspopup)
-
绑定三维标牌,一旦绑定之后,调用二维标牌的相关接口时,比如改变颜色、位置等,三维标牌会同步改变
Parameters:
Name Type Description cspopup
module:csview.Popup 三维标牌 -
unbind()
-
解除绑定三维标牌
-
getElement()
-
获取当前标牌的Html容器
-
getOffset()
-
获取当前标牌的偏移
Returns:
偏移- Type
- Array.<Number>
-
getPosition()
-
获取当前标牌的位置
Returns:
标牌所指示的位置- Type
- Coordinate
-
setElement(popupElement)
-
设置标牌显示在Html中的容器
Parameters:
Name Type Description popupElement
HTMLElement 包含标牌的容器 -
setOffset(offset)
-
设置标牌的偏移
Parameters:
Name Type Description offset
Array.<Number> 偏移量 Example
var popup = olView.createPopup([100,30], '标牌'); popup.setOffset([50,0]);
-
setPosition(lonlat)
-
设置标牌的位置
Parameters:
Name Type Description lonlat
Coordinate 标牌经纬度位置 Example
var popup = olView.createPopup([100,30], '标牌'); popup.setPosition([110,30]);
-
setContent(content)
-
设置标牌显示的内容,支持html
Parameters:
Name Type Description content
string 标牌内容 -
setLeadlineColor(color)
-
设置标牌牵引线的颜色
Parameters:
Name Type Description color
string 牵引线颜色 Example
var popup = olView.createPopup([100,30], '标牌'); popup.setLeadlineColor('red'); popup.setLeadlineColor('#FF0000');
-
setLeadlineWidth(width)
-
设置标牌牵引线的宽度
Parameters:
Name Type Description width
Number 牵引线的宽度 -
setLeadlineDash(dash)
-
设置牵引线的虚线模式显示样式,虚线样式请参考html中canvas的虚线格式
Parameters:
Name Type Description dash
Array.<Number> 牵引线的虚线样式 Example
var popup = olView.createPopup([100,30], '标牌'); popup.setLeadlineDash([2, 8]); popup.setLeadlineDash([6, 6]);
-
setVisible(visible)
-
设置标牌的显隐状态
Parameters:
Name Type Description visible
Boolean 标牌显隐 -
setLockable(lock)
-
设置标牌是否锁定,标牌默认是可以通过鼠标移动的,锁定之后就不能移动了
Parameters:
Name Type Description lock
Boolean 是否锁定