0
我想知道如果有人能幫助我的信息窗口的地址,我已搜查這個網站,但我還沒有找到一個答案谷歌地圖,在多個位置
我的JavaScript是生鏽的,如果別的,我有一個js小提琴這裏https://jsfiddle.net/ux8L7beg/
我想要做的是在infowindow彈出窗口中,我希望能夠通過我稱爲功能的變量顯示多個位置的標題,即當您將鼠標懸停在格拉斯哥上時,標題格拉斯哥陳列室將顯示在infowindow,我想我專注於這個特定的部分
var content = '<h3>' + "Showroom" + features + '</h3>' + ""
var infowindow = new google.maps.InfoWindow();
google.maps.event.addListener(marker, 'mouseover', (function(marker, content, infowindow) {
return function() {
infowindow.setContent(content);
infowindow.open(map, marker);
};
})(marker, content, infowindow));
}
/* add showroom locations */
var features = [{
position: new google.maps.LatLng(55.8511441, -4.2793418),
type: 'showroom',
title: 'Glasgow Showroom'
}, {
position: new google.maps.LatLng(53.3497877, -1.4821523),
type: 'showroom',
title: 'Sheffield Showroom'
},
任何人都可以指出我正確的方向?
感謝 羅比
您對發佈的代碼有什麼問題?請提供證明該問題的[mcve]。我在你的小提琴上看到了每個標記(我檢查過)上的信息。 – geocodezip
不知道你在問什麼。這有幫助嗎? https://jsfiddle.net/ux8L7beg/2/ –
Thankyou Emmanuel,這正是我正在尋找的 – user7095477