-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtest-bmap-3d.html
55 lines (50 loc) · 1.39 KB
/
test-bmap-3d.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
<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport"
content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<title>BMap</title>
<style>
html, body {
width: 100%;
height: 100%;
padding: 0;
margin: 0;
}
#map {
width: 100%;
height: 100%;
}
.anchorBL,.BMap_cpyCtrl {
display: none;
}
</style>
</head>
<body>
<div id="map"></div>
<script type="text/javascript">
function init (){
var map = new BMapGL.Map('map')
var point = new BMapGL.Point(114.064552, 22.548457)// 深圳
map.centerAndZoom(point, 20)
map.enableScrollWheelZoom(true)
let heading = 0
map.setHeading(heading)
map.setTilt(70)
// 不推荐使用
setInterval(()=>{
heading ++
map.setHeading(heading)
}, 500)
}
//https://api.map.baidu.com/api?v=1.0&type=webgl&ak=2bmncLvRzj6711pQ0LQnbfciTAe6CvLz
window.onload = function (){
var script = document.createElement('script')
script.src='https://api.map.baidu.com/api?v=1.0&type=webgl&ak=2bmncLvRzj6711pQ0LQnbfciTAe6CvLz&callback=init'
document.body.appendChild(script)
}
</script>
</body>
</html>