Вопрос

I am using Infoboxes to display info for markers on a GoogleMapv3. I would like to display multiple tabs within each marker, but haven't found any good examples on how to do this. My code to do the markers and InfoBoxes looks like this:

 //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);
        });
Это было полезно?

Решение

You might want to take a look at the InfoBubble library. For an examples see here.

Лицензировано под: CC-BY-SA с атрибуция
Не связан с StackOverflow
scroll top