google map v3 弹出信息框
当鼠标移到(mouseover)标注点时会自动信息弹出对话框
代码:
var coordInfoWindow = new google.maps.InfoWindow();
var content = ['<div style="text-align: center; font-size:14px;"><center><b>Diamantino, Brazil</b></center><img width="240" height="180" src="http://mw2.google.com/mw-panoramio/photos/small/7253919.jpg"/><div style="margin: auto; text-align: right; width: 240px;" class="linkbutton"><a href="http://www.panoramio.com/user/279908">Edson Walter Cavalari</a></div><div class="linkbutton"><a href="http://www.panoramio.com/photo/7253919" target="_blank">See more photos at Panoramio.com</a></div><br/><div class="linkbutton"><a href="" target="_blank">Read more about this location</a></div><div class="linkbutton"><a href="javascript:void(0)" id="zoomLink">Zoom in to this location</a></div></div>'].join('<br>');
google.maps.event.addListener(marker, 'mouseover', function () {
coordInfoWindow.setContent(content);
coordInfoWindow.setPosition(new google.maps.LatLng(location.lat, location.lng));
coordInfoWindow.open(map);
});
如图: