-1

我正在使用信息来显示 GoogleMapv3 上的标记信息。我想在每个标记中显示多个选项卡,但没有找到任何关于如何做到这一点的好例子。我做标记和信息框的代码如下所示:

 //create a new marker for this coordinate
        var marker = new google.maps.Marker({
            title:title,
            content:html,
            map:map,
            draggable:false,
            position:pathCoordinates[i],
            icon: iconImg
        });

        //attach a 'click' listener to the marker and assign it a new InfoBox with related data
        google.maps.event.addListener(marker, 'click', function() {
            var infobox = new InfoBox({
                content: this.content,
                maxWidth: 150,
                pixelOffset: new google.maps.Size(-140, 0),
                zIndex: null,
                boxStyle: {
                    width: "280px"
                },
                closeBoxMargin: "8px 10px 2px 2px",
                infoBoxClearance: new google.maps.Size(1, 1)
            });
            infobox.open(map,this);
        });
4

1 回答 1

1

您可能想看看InfoBubble库。有关示例,请参见此处

于 2013-11-06T13:45:34.707 回答