谷歌将v3标记映射到信息框

时间:2015-04-03 08:36:23

标签: google-maps-api-3 layer markers pane infobox

我正在使用google maps v3创建网站https://yachtcharterbook.com。我得到标记和infowindows标记鼠标弹出。当infowindows出现时,我尝试通过鼠标导航它,但当另一个标记在它下面时 - 当前信息窗口关闭,第二个弹出窗口。层或面板或z-index存在问题,我真的不明白。我尝试使用infowindow窗格:' floatPane',窗格:' mapPane',zIndex on infowindow和markers但没有更改。也许你有一些想法为什么会这样?

var ib = new InfoBox();
            latLng = new google.maps.LatLng(38.909593, -76.419036);
                marker[282] = new google.maps.Marker({
                position: latLng,
                map: map,
                icon: defIcon
            });

            var infobox282 = {
                content: document.getElementById('infobox282'),
                disableAutoPan: false,
                maxWidth: 0,
                pane: 'floatPane',
                pixelOffset: new google.maps.Size(20, -74),
                zIndex: null,
                alignBottom: false
            };

            google.maps.event.addListener(marker[282], 'mouseover', function() {
                ib.close();
                ib.setOptions(infobox282)
                ib.open(map, this);
            });

<div class="bubble" id="infobox282">
            <h1>США, <span>Chesapeake Bay</span></h1><div class="objects">
                    <div class="link">
                        <a href="https://yachtcharterbook.com/ru/yacht-charter/country/230/area/282/prop_type/6">Парусные катамараны (1)</a>
                    </div>
                </div><div class="objects">
                    <div class="link">
                        <a href="https://yachtcharterbook.com/ru/yacht-charter/country/230/area/282/prop_type/5">Парусные яхты (13)</a>
                    </div>
                </div><div class="objects">
                    <div class="link">
                        <a href="https://yachtcharterbook.com/ru/yacht-charter/country/230/area/282">Все яхты (14)</a>
                    </div>
                </div></div>

谢谢!

1 个答案:

答案 0 :(得分:1)

解决。刚添加优化:false到标记。

latLng = new google.maps.LatLng(38.909593, -76.419036);
                marker[282] = new google.maps.Marker({
                position: latLng,
                map: map,
                icon: defIcon,
                optimized: false
            });