-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.html
40 lines (39 loc) · 1.12 KB
/
index.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
<!DOCTYPE html>
<html>
<head>
<title>2048</title>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0" />
<meta content="yes" name="apple-mobile-web-app-capable" />
<meta content="black" name="apple-mobile-web-app-status-bar-style" />
<script type="text/javascript" src="//api.map.baidu.com/api?v=2.0&ak=rXEWhxDjgbhoLBrRgCWptx08MUpFyaIP"></script>
</head>
<style>
body {
margin: 0;
padding: 0;
width: 100%;
}
#canvas {
background-color: #ccc0b2;
border-radius: 10px;
display: block;
margin: 0 auto;
}
</style>
<body>
<canvas id="canvas"></canvas>
<script src="game.js"></script>
<script>
var geolocation = new BMap.Geolocation();
geolocation.getCurrentPosition(function (r) {
alert(r.point.lng + ", " + r.point.lat)
if (this.getStatus() === 0) {
var point = new BMap.Point(r.point.lng, r.point.lat);
} else {
alert("不能获取您当前的位置!");
}
})
</script>
</body>
</html>