当前位置: 代码迷 >> Web前端 >> google 地图 弹出信息框
  详细解决方案

google 地图 弹出信息框

热度:121   发布时间:2013-01-26 13:47:01.0
google map 弹出信息框

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);
?});

???? 如图:

  相关解决方案