-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path3.html
50 lines (48 loc) · 1.2 KB
/
3.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
<!DOCTYPE HTML>
<html>
<head>
<meta name="viewport" content="width=device-width initial-scale=1.0 maximum-scale=1.0 user-scalable=0">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>3D地图</title>
<style>
body,html{ margin:0;padding:0;font:12px/16px Verdana,Helvetica,Arial,sans-serif;width: 100%;height: 100%}
.container{
height: 100%
}
</style>
<script language="javascript" src="https://webapi.amap.com/maps?v=2.0&key=27d095a8e552da2dbb2f05d06684b9d4&plugin=AMap.ControlBar,AMap.ToolBar"></script>
</head>
<body >
<div id="container" style="width:100%; height:100%;resize:both;"></div>
<script language="javascript">
var map;
function mapInit(){
map = new AMap.Map('container', {
rotateEnable:true,
pitchEnable:true,
zoom: 17,
pitch: 50,
rotation: -15,
viewMode:'3D', //开启3D视图,默认为关闭
zooms:[2,20],
center:[117.222354,31.797747]
});
var controlBar = new AMap.ControlBar({
position:{
right:'10px',
top:'10px'
}
});
controlBar.addTo(map);
var toolBar = new AMap.ToolBar({
position:{
right:'40px',
top:'110px'
}
});
toolBar.addTo(map);
}
mapInit()
</script>
</body>
</html>