Bing Maps V8如何为信息框设置自动高度和宽度?

时间:2018-08-12 12:50:54

标签: bing-maps infobox

我将Bing Maps用于具有多个图钉及其相应信息框的wordpress项目。由于信息框中的内容很大,包含多个信息,因此我无法查看所有信息(不过有一个垂直滚动条)。我想删除该滚动条,并向信息框添加自动高度和宽度。怎么做我尝试了以下方法,但没有成功。

function pushpinClicked(e) {
        //Make sure the infobox has metadata to display.
        if (e.target.metadata) {
            //Set the infobox options with the metadata of the pushpin.
            infobox.setOptions({
                location: e.target.getLocation(),
                title: e.target.metadata.title,
                description: e.target.metadata.description,
                visible: true
            });
            map.setView({center:e.target.getLocation(),zoom:4})
            adjustHeightInfobox();
        }
    }
    function adjustHeightInfobox() {
        var newHeight = jQuery("#iw_container").height();
        alert(newHeight);
        infobox.setOptions({height:newHeight+15});
    }

欢迎任何帮助/建议。预先感谢。

0 个答案:

没有答案