-
Notifications
You must be signed in to change notification settings - Fork 2
/
api.html
56 lines (54 loc) · 1.3 KB
/
api.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
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
<script charset="utf-8" src="http://map.qq.com/api/js?v=2.exp&libraries=drawing,geometry,autocomplete,convertor"></script>
<style type="text/css">
html,body{
width:100%;
height:100%;
}
*{
margin:0px;
padding:0px;
}
body, button, input, select, textarea {
font: 12px/16px Verdana, Helvetica, Arial, sans-serif;
}
p{
width:603px;
padding-top:3px;
overflow:hidden;
}
.btn{
width:142px;
}
#container{
min-width:600px;
min-height:767px;
}
</style>
<script>
window.onload = function(){
//直接加载地图
//初始化地图函数 自定义函数名init
function init() {
//定义map变量 调用 qq.maps.Map() 构造函数 获取地图显示容器
var map = new qq.maps.Map(document.getElementById("container"), {
center: new qq.maps.LatLng(39.916527,116.397128), // 地图的中心地理坐标。
zoom:13 // 地图的中心地理坐标。
});
var polyline = new qq.maps.Polyline({
path: [
new qq.maps.LatLng(39.910, 116.399),
new qq.maps.LatLng(39.920, 116.399),
new qq.maps.LatLng(39.930, 116.399),
new qq.maps.LatLng(39.920, 116.389),
new qq.maps.LatLng(39.910, 116.369)
],
strokeColor: '#E00000',
strokeWeight: 1,
map
});
}
//调用初始化函数地图
init();
}
</script>
<div id="container" style="width:500px; height:300px"></div>