-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path添加标注.html
23 lines (23 loc) · 955 Bytes
/
添加标注.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
<!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=n4GwrK01fIOnpEiDkz7wy5rO"></script>
<title>测距</title>
</head>
<body>
<div id="allmap"></div>
</body>
</html>
<script type="text/javascript">
var map = new BMap.Map("allmap");
map.centerAndZoom(new BMap.Point(108.961605,34.238296), 14);
var marker1 = new BMap.Marker(new BMap.Point(108.961605,34.238296)); // 创建标注
map.addOverlay(marker1); // 将标注添加到地图中
var infoWindow1 = new BMap.InfoWindow("普通标注");
// marker1.addEventListener("click", function(){this.openInfoWindow(infoWindow1);});
</script>