2011-06-27 38 views

回答

2

基本上你需要为该标记注册和事件监听器......所以当用户点击它时,会触发一个函数。

marker = new google.maps.Marker({ 
     map:map, 
     draggable:true, 
     animation: google.maps.Animation.DROP, 
     position: parliament 
    }); 

google.maps.event.addListener(marker, 'click', showInfo); 

function showInfo() { 
    //display info whereever you like. 
} 

P.S.这只是示例代码,因此您需要根据自己的需求进行调整。

希望这有助于

相关问题