HTML 百度地图API调用示例源码

<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title>百度地图API调用示例</title>
<style>
.iwTitle {
    color: #CC5522;
    font-size: 14px;
    font-weight: bold;
    white-space: nowrap;
}
body
{
 font-size: 12px;
}
</style>
<script type="text/javascript" src="http://api.map.baidu.com/api?v=1.2"></script>
</head>
<body>
<div  ></div>
</body>
</html>
<script type="text/javascript">
var map = new BMap.Map("container");
var point = new BMap.Point(116.85,40.37);
var marker = new BMap.Marker(point);
var opts = {
  width : 200,     // 信息窗口宽度
  height: 80,     // 信息窗口高度
  title : "<span class='iwTitle' >百度地图API调用示例</span>", // 信息窗口标题

}
map.addControl(new BMap.NavigationControl());  
map.centerAndZoom(point, 15);
map.addOverlay(marker);

var infoWindow = new BMap.InfoWindow("地址:北京市区<br />网址:http://www.baidu.com", opts);  // 创建信息窗口对象
map.openInfoWindow(infoWindow, map.getCenter());      // 打开信息窗口
</script>