HTML嵌百度地图

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name="viewport" content="initial-scale=1.0, user-scalable=no" />
<script type="text/javascript"
src="http://api.map.baidu.com/api?v=1.5&ak=百度密钥"></script>
<title>百度地图的Hello, World</title>
<style type="text/css">
body,html,#allmap {
width: 150px;
height: 150px;
overflow: hidden;
margin: 0;
}
</style>
</head>
<body>
<div id="allmap"></div>
</body>
</html>
<script type="text/javascript">
// 百度地图API功能
var map = new BMap.Map("allmap"); // 创建Map实例
var point = new BMap.Point(121.458999, 31.287016); // 创建点坐标
map.centerAndZoom(point, 15); // 初始化地图,设置中心点坐标和地图级别。
var marker = new BMap.Marker(point); // 创建标注    
map.addOverlay(marker);
map.enableScrollWheelZoom(); //启用滚轮放大缩小
</script>

你可能感兴趣的:(html)