我正在使用Infoboxes来显示GoogleMapv3上标记的信息。我想在每个标记中显示多个选项卡,但是没有找到关于如何执行此操作的任何好示例。我做标记和InfoBoxes的代码如下所示:
//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);
});