此代码用于在百度地图中标注某个指定的坐标,并当鼠标指向时显示批定内容
JavaScript代码
- <script type="text/javascript" src="http://api.map.baidu.com/api?v=1.3"></script>
- <div style="width:520px;height:340px;border:1px solid gray" id="container"></div>
- <script type="text/javascript">
- var map = new BMap.Map("container");
-
-
-
- map.centerAndZoom(new BMap.Point(115.759973,33.863148), 15);
- map.addControl(new BMap.NavigationControl());
- var point = new BMap.Point(115.759973,33.863148);
- map.centerAndZoom(point, 15);
-
- var marker = new BMap.Marker(point);
- map.addOverlay(marker);
- marker.setAnimation(BMAP_ANIMATION_BOUNCE);
-
- </script>