Optional
options: PopupOptionsOptional
_pos获取信息弹出框元素.
Returns container element.
// Change the `Popup` element's font size
const popup = new vjvjmap3d.Popup()
.setLngLat([-96, 37.8])
.setHTML("<p>Hello World!</p>")
.addTo(app);
const popupElem = popup.getElement();
popupElem.style.fontSize = "25px";
从弹出式容器元素中删除一个CSS类。
Non-empty string with CSS class name to remove from popup container.
Returns itself to allow for method chaining.
const popup = new vjvjmap3d.Popup({className: 'some classes'});
popup.removeClassName('some');
将弹出窗口的内容设置为作为DOM节点提供的元素.
A DOM node to be used as content for the popup.
Returns itself to allow for method chaining.
// create an element with the popup content
const div = window.document.createElement('div');
div.innerHTML = 'Hello, world!';
popup.setDOMContent(div)
设置信息弹出框偏移量
Optional
offset: PopopOffsetSets the popup's offset. The Object
is of the following structure
this
.
popup.setOffset(10);
设置信息弹出框信息内容.
This function creates a Text node in the DOM, so it cannot insert raw HTML. Use this method for security against XSS if the popup content is user-provided.
Textual content for the popup.
Returns itself to allow for method chaining.
popup.setText('Hello, world!')
在弹出容器上添加或删除给定的CSS类,具体取决于容器当前是否具有该类。
Non-empty string with CSS class name to add/remove.
If the class was removed return false
. If the class was added, then return true
.
const popup = new vjvjmap3d.Popup();
popup.toggleClassName('highlighted');
Static
normalizeOptional
offset: PopopOffset
2d的html的信息弹出窗