forked from wolfwind521/indoor3D
-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.html
69 lines (61 loc) · 1.98 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
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
<!DOCTYPE html>
<html>
<head lang="en">
<meta charset="UTF-8">
<title></title>
</head>
<body>
<script src="js/three.min.js"></script>
<script src="js/Detector.js"></script>
<script src="js/OrbitControls.js"></script>
<script src="js/IndoorMap.js"></script>
<script src="js/Projector.js"></script>
<script src="js/stats.min.js"></script>
<script src="js/IndoorMap2d.js"></script>
<script src="js/IndoorMap3d.js"></script>
<link href="css/indoor3D.css" rel="stylesheet">
<div id="indoor3d" style="width: 800px; height: 500px; top:50px; left: 100px; position: absolute"></div>
<script>
var stats = new Stats();
stats.domElement.style.position = 'absolute';
stats.domElement.style.top = '0px';
document.body.appendChild(stats.domElement);
animate();
var params = {
// mapDiv:"indoor3d"
// ,
dim:"2d"
}
var indoorMap = IndoorMap(params);
///--------------parse function test-------------------
var testjson;
var loader = new IndoorMapLoader(indoorMap.is3d);
loader.load('data/爱琴海购物中心.json', function(mall){
testjson = mall.jsonData;
indoorMap.parse(testjson);
indoorMap.setSelectable(true);
var ul = IndoorMap.getUI(indoorMap);
document.body.appendChild(ul);
});
///---------------load function test--------------------
// indoorMap.load('data/赛特购物中心.json', function(){
// indoorMap.showFloor(1);
// indoorMap.showAreaNames(true);
// indoorMap.setSelectable(true);
// var ul = indoorMap.getUI();
// document.body.appendChild(ul);
// });
function animate(){
requestAnimationFrame(animate);
stats.update();
}
</script>
<!-- buttons just for test-->
<ul class="testButton">
<li onclick="indoorMap.zoomIn(0.8)">放大</li>
<li onclick="indoorMap.zoomOut(0.8)">缩小</li>
<li onclick="indoorMap.setTopView()">顶视图</li>
<li onclick="indoorMap.setDefaultView()">默认透视图</li>
</ul>
</body>
</html>