-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMap1.html
34 lines (30 loc) · 1007 Bytes
/
Map1.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
<meta name="viewport" content="initial-scale=1.0, user-scalable=no"/>
<style type="text/css">
body, html, #allmap {
width: 100%;
height: 100%;
overflow: hidden;
margin: 0;
font-family: "微软雅黑";
}
</style>
<script type="text/javascript"
src="http://api.map.baidu.com/api?v=2.0&ak=vK9dQIay1e6UwEkhb02BNDGpmCbSt2Pe"></script>
<title>地图展示</title>
</head>
<body>
<div id="allmap"></div>
</body>
</html>
<script type="text/javascript">
var map = new BMap.Map("allmap");
var point = new BMap.Point(117.366288,32.926397);
map.enableScrollWheelZoom(true); //开启鼠标滚轮缩放
map.centerAndZoom(point, 20);
var marker = new BMap.Marker(point); // 创建标注
map.addOverlay(marker); // 将标注添加到地图中
</script>