2012-10-19 58 views
-1

我需要在infowindow中創建一個表,以顯示第一個信息和第二個顯示的照片庫,也如何展開表2中的照片在事件中(鼠標懸停)我如何創建與選項卡infowindow

這裏是我的代碼

var marker = new google.maps.Marker({ 
    map: map, 
    position: new google.maps.LatLng(-8.759264,-63.906463),  
    icon: predio 
}); 

var contentimage = 
    '<div style="width:470px;height:220px;margin:auto;float:left;" /div>' + 
    '<div>' + 
     '<img src="images/Sem título-2.png" width="440" height="190" />' + 
     '<a href="http://www.google.com.br" target="_blank">www.seusite.com.br/galeriadefotos</a>' + 
    '</div>'; 


var infowindow = new google.maps.InfoWindow({content: contentimage}); 

google.maps.event.addListener(marker, 'click', function() { 
    infowindow.open(map,marker); 
}); 

回答

0

信息窗口的內容是像任何其他DOM節點,例如:

var content = '<table><tr><td>1.1</td><td>1.2</td></tr><tr><td>2.1</td><td>2.2</td></tr></table>'; 
infoWindow.setContent(content); 
infoWindow.open(map,marker); 
+0

感謝您的反饋..但對不起,我不好表達自己,是什麼我真的想要的是一個infowindow與「標籤」一樣在這個例子http://econym.org.uk/gmap/example_map10.htm – Frank021

+0

您的鏈接是API V2。 API V3沒有標籤式的infoWindow。如果你想在V3中使用標籤,你需要使用像infoBubble這樣的第三方加載項:http://google-maps-utility-library-v3.googlecode.com/svn/trunk/infobubble/examples/example.html/ – Marcelo

+0

得到它兄弟,感謝您的幫助,也知道如何把Facebook的按鈕,在infowindow ..欣賞.. – Frank021

相關問題