<!DOCTYPE HTML>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gbk" />
<title>厦门网站建设电子地图</title>
<script src="http://api.map.baidu.com/api?key=f9a61e8fb9ed9538750b340598dc6e35&v=&services=true" type="text/javascript"></script>
</head>
<body>
<div style="width:550px;height:400px;border:1px solid gray" id="container"></div>
<script type="text/javascript">
var map = new BMap.Map("container");
map.centerAndZoom(new BMap.Point(106.51241898536682, 29.583459540876585), 15);
var local = new BMap.LocalSearch(map, {
renderOptions:{map: map}
});
local.search("厦门市思明区嘉禾路337号");
map.addControl(new BMap.NavigationControl({type: BMAP_NAVIGATION_CONTROL_SMALL}));
var marker = new BMap.Marker(new BMap.Point(106.51241898536682, 29.583459540876585));
map.addOverlay(marker);
marker.addEventListener("click", function(){this.openInfoWindow(infoWin);});
var infoWinOpts = {
width : 200
,height : 60
}
map.enableScrollWheelZoom();
</script>
</body>
</html>
第二种看你适合那种!
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gbk" />
<title>地图</title>
<script src="http://api.map.baidu.com/api?key=f9a61e8fb9ed9538750b340598dc6e35&v=1.0&services=true" type="text/javascript"></script>
</head>
<body>
<div style="width:520px;height:340px;border:1px solid gray" id="container"></div>
</body>
</html>
<SCRIPT LANGUAGE="JavaScript">
var map = new BMap.Map("container");
var point = new BMap.Point(106.51241898536682, 29.583459540876585);//地图的经纬度坐标(经度坐标,纬度坐标)
map.centerAndZoom(point, 15); // 初始化:point初始要定位到的点,15:地图显示级别即比例尺,值越大显示的越详细
map.addControl(new BMap.NavigationControl({type: BMAP_NAVIGATION_CONTROL_SMALL}));
var marker = new BMap.Marker(new BMap.Point(106.51241898536682, 29.583459540876585));
map.addOverlay(marker);
marker.addEventListener("click", function(){this.openInfoWindow(infoWin);});
var infoWinOpts = {
width : 200
,height : 60
}
var infoWin = new BMap.InfoWindow("<div style='text-align:left;margin-top:3px;font-size:12;color:#1A6DAF'>厦门网站建设中智能<br>地址:嘉禾路337号中关委大厦1710 <br>电话:5123908</div>",infoWinOpts); //点击显示文字
marker.openInfoWindow(infoWin);
map.enableScrollWheelZoom(); //用鼠标滚轴
</SCRIPT>