【问题标题】:How to set offset on google maps infobox如何在谷歌地图信息框上设置偏移量
【发布时间】:2013-08-17 18:01:49
【问题描述】:

我有一个可变宽度的信息框 (http://google-maps-utility-library-v3.googlecode.com/svn/trunk/infobox/docs/examples.html)。如何设置偏移量,使其每次都显示在标记上?

infobox = new InfoBox({
     alignBottom: true,
     content: document.getElementById("infobox"),
     disableAutoPan: false,
     maxWidth: "",
     pixelOffset: ?????????
     zIndex: null,
     boxStyle: {
        background: "url('http://google-maps-utility-library-v3.googlecode.com/svn/trunk/infobox/examples/tipbox.gif') no-repeat",
        opacity: 1,

    },
    closeBoxMargin: "12px 4px 2px 2px",
    closeBoxURL: "http://www.google.com/intl/en_us/mapfiles/close.gif",
    infoBoxClearance: new google.maps.Size(1, 1)
});

【问题讨论】:

  • 你是如何打开信息框的?

标签: google-maps google-maps-api-3 infobox


【解决方案1】:

它是信息框相对于标记的位置。

默认设置在右边140px,所以分别设置x和y的值,每次都会出现方框。

【讨论】:

    猜你喜欢
    • 2013-02-03
    • 1970-01-01
    • 2017-09-13
    • 1970-01-01
    • 2015-06-14
    • 2014-11-01
    • 1970-01-01
    • 2012-02-29
    • 2023-03-30
    相关资源
    最近更新 更多