Summary
Methods:
get |
获取构造叠加物时,属性options中key对应的value值。 |
getDomId |
获取叠加物的div元素的id值。 |
getElement |
获取当前叠加物内容中的DOM元素。 |
getLayer |
获取叠加物所在图层对象。 |
getLocation |
获取叠加物左上角的地理位置。 |
getOffset |
获取在叠加物地理坐标上增加的偏移量。 |
getVisibility |
获得当前Overlay是否可见 |
setDomId |
设置叠加物的div元素的id值。 |
setElement |
重新设置叠加物中的DOM内容。 |
setLocation |
重新设置叠加物的锚点的地理坐标。 |
setOffset |
基于叠加物的地理坐标,设置偏移量。 |
setVisibility |
设置叠加物对象的DOM元素的显示隐藏。 |
Constructor
new ArrawPopup(options)
构造函数。
Parameters:
Name | Type | Description | |||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
options |
Object | 可选项,其他参数说明请参见基类hmap.overlay.Overlay的参数说明。
|
Example
let content = document.createElement("div");
content.innerHTML = "带引导线的弹框内容";
let location = new Coordinate(120.435078, 30.19345, 0);
let arrawPopup = new hmap.overlay.ArrawPopup({
"visible":true,
"domId":"a",
"element":content,
"location":location,
"offset": new hmap.basetype.Offset(10,10),
"anchorType": "ellipse",
"anchorWidth": 2,
"anchorHeight": 2,
"anchorFillColor": new hmap.style.Color(0,0,0,1),
"anchorStrokeColor": new hmap.style.Color(255,0,0,1),
"anchorStrokeWidth": 2,
"linePointOffsetArr": [new hmap.basetype.Offset(10,10),new hmap.basetype.Offset(20,10)],
"lineWidth": 5,
"lineColor": new hmap.style.Color(0,0,0,1),
"popOffsetLine": new hmap.basetype.Offset(0,0)
});
Methods
-
get(key) → {Object}
-
获取构造叠加物时,属性options中key对应的value值。
Parameters:
Name Type Description key
String 属性options中的键。
Returns:
Object -键对应的value值
-
getDomId() → {String}
-
获取叠加物的div元素的id值。
Returns:
String -id值。
-
getElement() → {HTMLElement}
-
获取当前叠加物内容中的DOM元素。
Returns:
HTMLElement -返回叠加物的DOM内容。
-
getLayer() → {module:layer~OverlayLayer}
-
获取叠加物所在图层对象。
-
getLocation() → {module:basetype~Coordinate}
-
获取叠加物左上角的地理位置。
-
getOffset() → {module:basetype~Offset}
-
获取在叠加物地理坐标上增加的偏移量。
-
getVisibility() → {Boolean}
-
获得当前Overlay是否可见
Returns:
Boolean -
setDomId(domId) → {module:overlay~Overlay}
-
设置叠加物的div元素的id值。
Parameters:
Name Type Description domId
String id值。
-
setElement(element) → {module:overlay~Overlay}
-
重新设置叠加物中的DOM内容。
Parameters:
Name Type Description element
HTMLElement DOM对象。
-
setLocation(location) → {module:overlay~Overlay}
-
重新设置叠加物的锚点的地理坐标。
Parameters:
Name Type Description location
module:basetype~Coordinate 地理坐标。
Throws:
-
setOffset(offset) → {module:overlay~Overlay}
-
基于叠加物的地理坐标,设置偏移量。
Parameters:
Name Type Description offset
module:basetype~Offset 偏移量对象。
-
setVisibility(visible)
-
设置叠加物对象的DOM元素的显示隐藏。
Parameters:
Name Type Default Description visible
Boolean true 显示设置true,隐藏设置false。