-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtest-bmap-earth.html
50 lines (45 loc) · 1.26 KB
/
test-bmap-earth.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 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, 8)
map.enableScrollWheelZoom(true)
map.setHeading(60)
map.setTilt(0)
map.setMapType(BMAP_EARTH_MAP)
}
//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>