overlay~AdaptPopup(options)

自适应弹框,即在拖动地图时,弹框会随地图拖动而改变位置,使弹框尽量在屏幕内显示。随着弹框数量增多,渲染性能会有明显下降。

Summary

Methods:

Constructor

new AdaptPopup(options)

Parameters:
Name Type Description
options Object

可选项,请参见基类hmap.overlay.Overlay的参数说明。

Name Type Description
scaleFactor Number

模拟近大远小以及前后关系的因子,为0时表示没有效果,值越大缩放效果越明显,默认没有近大远小的效果

Example
let content = document.createElement("div");
content.textContent = "适配弹框内容";
let location = new hmap.basetype.Coordinate(120.435078, 30.19345, 0);
let adaptPopup = new hmap.overlay.AdaptPopup({
     "visible":true,
     "domId":"a",
     "element":content,
     "location":location,
     "offset": new hmap.basetype.Offset(10,10)
});

Methods