forked from potree/potree
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.html
170 lines (153 loc) · 8.25 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
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="description" content="">
<meta name="author" content="">
<meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=no">
<title>NC50 BasinView</title>
<link rel="stylesheet" type="text/css" href="./build/potree/potree.css">
<link rel="stylesheet" type="text/css" href="./libs/jquery-ui/jquery-ui.min.css">
<link rel="stylesheet" type="text/css" href="./libs/openlayers3/ol.css">
<link rel="stylesheet" type="text/css" href="./libs/spectrum/spectrum.css">
<link rel="stylesheet" type="text/css" href="./libs/jstree/themes/mixed/style.css">
</head>
<body>
<script src="./libs/jquery/jquery-3.1.1.min.js"></script>
<script src="./libs/spectrum/spectrum.js"></script>
<script src="./libs/jquery-ui/jquery-ui.min.js"></script>
<script src="./libs/other/BinaryHeap.js"></script>
<script src="./libs/tween/tween.min.js"></script>
<script src="./libs/d3/d3.js"></script>
<script src="./libs/proj4/proj4.js"></script>
<script src="./libs/openlayers3/ol.js"></script>
<script src="./libs/i18next/i18next.js"></script>
<script src="./libs/jstree/jstree.js"></script>
<script src="./libs/copc/index.js"></script>
<script src="./build/potree/potree.js"></script>
<script src="./libs/plasio/js/laslaz.js"></script>
<!-- INCLUDE ADDITIONAL DEPENDENCIES HERE -->
<!-- INCLUDE SETTINGS HERE -->
<div class="potree_container" style="position: absolute; width: 100%; height: 100%; left: 0px; top: 0px; ">
<div id="potree_render_area" style="background-color: black"></div>
<div id="potree_sidebar_container"></div>
<button
id="remove_tree_btn"
onclick="toggleUnclassified"
style="position: absolute; top: 10px; right: 10px; z-index: 1000; padding: 10px; background-color: unset; color: white; border: 1px solid white; cursor: pointer; border-radius: 3px;"
>
Toggle Trees
</button>
<svg width="180" height="62" viewBox="0,0,180,38"
style="position: absolute; bottom: 5px; right: 5px; z-index: 1000; overflow: visible; display: block; background-color: rgba(0,0,0,0.8); padding: 0px 16px 42px 16px; border-radius: 3px;">
<g transform="translate(0, 0)">
<text x="90" y="5" fill="white" text-anchor="middle" font-size="12px" class="title">Ground Points</text>
<text x="90" y="17" fill="white" text-anchor="middle" font-size="12px" class="title">Subcanopy Solar
Radiation
</text>
<text x="90" y="30" fill="white" text-anchor="middle" font-size="12px" class="title">Light Penetration
Index
</text>
</g>
<image x="0" y="36" width="180" height="24" preserveAspectRatio="none"
href="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAQAAAAABCAYAAAAxWXB3AAAAAXNSR0IArs4c6QAAAQJJREFUOE91UtlRxTAMXDlJF9RB/53QCM+CXR3WY4YPzR46Yluxj88vxwXgBoQZJu3H6/zwOl/ewEWeUXzi2pEn0hdmWKBT22v4L+n2K0fM8Obf7UXuaG9eXiKOtj9zjD2IOcxVnr4hdMUS3/LJl+2D2LikAxXyXHFLE09QP4bwuKrEpzXwyI81tp9rLf+GRX+uuXGsdHn8DoxeV3KtCS7fyBtdenrmxwNzXKU7Doc4yt+hWVf+v6gaU6/CDT44Pd/Mm2YVF6qP9cQFb72yfsE3OZH1U6937VWXKH1F/+ybdTrrrB/f6JzluTgnz1rn1Ky4x9t96j2m35zvVDPHm/z2/AAvZQN5o3+FpQAAAABJRU5ErkJggg=="></image>
<g transform="translate(0,60)">
<g fill="none" font-size="10" font-family="sans-serif" text-anchor="middle" style="color: white;">
<g class="tick" opacity="1" transform="translate(0,0)">
<line stroke="currentColor" y2="6" style="stroke: white; stroke-width: 1px;"></line>
<text fill="currentColor" y="9" dy="0.71em">0.0</text>
</g>
<g class="tick" opacity="1" transform="translate(36,0)">
<line stroke="currentColor" y2="6" style="stroke: white; stroke-width: 1px;"></line>
<text fill="currentColor" y="9" dy="0.71em">0.2</text>
</g>
<g class="tick" opacity="1" transform="translate(72,0)">
<line stroke="currentColor" y2="6" style="stroke: white; stroke-width: 1px;"></line>
<text fill="currentColor" y="9" dy="0.71em">0.4</text>
</g>
<g class="tick" opacity="1" transform="translate(108,0)">
<line stroke="currentColor" y2="6" style="stroke: white; stroke-width: 1px;"></line>
<text fill="currentColor" y="9" dy="0.71em">0.6</text>
</g>
<g class="tick" opacity="1" transform="translate(144,0)">
<line stroke="currentColor" y2="6" style="stroke: white; stroke-width: 1px;"></line>
<text fill="currentColor" y="9" dy="0.71em">0.8</text>
</g>
<g class="tick" opacity="1" transform="translate(180,0)">
<line stroke="currentColor" y2="6" style="stroke: white; stroke-width: 1px;"></line>
<text fill="currentColor" y="9" dy="0.71em">1.0</text>
</g>
</g>
<g fill="none" font-size="10" font-family="sans-serif" text-anchor="middle">
<g class="tick" opacity="1" transform="translate(18,0)">
<line stroke="currentColor" y2="2" style="stroke: white; stroke-width: 0.5px;"></line>
<text fill="currentColor" y="5" dy="0.71em"></text>
</g>
<g class="tick" opacity="1" transform="translate(54,0)">
<line stroke="currentColor" y2="2" style="stroke: white; stroke-width: 0.5px;"></line>
<text fill="currentColor" y="5" dy="0.71em"></text>
</g>
<g class="tick" opacity="1" transform="translate(90,0)">
<line stroke="currentColor" y2="2" style="stroke: white; stroke-width: 0.5px;"></line>
<text fill="currentColor" y="5" dy="0.71em"></text>
</g>
<g class="tick" opacity="1" transform="translate(126,0)">
<line stroke="currentColor" y2="2" style="stroke: white; stroke-width: 0.5px;"></line>
<text fill="currentColor" y="5" dy="0.71em"></text>
</g>
<g class="tick" opacity="1" transform="translate(162,0)">
<line stroke="currentColor" y2="2" style="stroke: white; stroke-width: 0.5px;"></line>
<text fill="currentColor" y="5" dy="0.71em"></text>
</g>
</g>
</g>
</svg>
</div>
<script type="module">
window.viewer = new Potree.Viewer(document.getElementById("potree_render_area"));
viewer.setEDLEnabled(true);
viewer.setFOV(60);
viewer.setPointBudget(2_000_000);
viewer.useHQ = true;
viewer.loadSettingsFromURL();
viewer.loadGUI(() => {
viewer.setLanguage('en');
$("#menu_appearance").next().show();
});
var path = "https://hakai-geospatial-public.s3.us-east-1.amazonaws.com/nc50/salmonExpandedColor.copc.laz";
var name = "NC50 BasinView";
viewer.setDescription(name);
// Noise hidden by default
viewer.setClassificationVisibility("7", false);
var showUnclassified = true
document.getElementById("remove_tree_btn").onclick = function () {
console.log("toggle unclassified")
showUnclassified = !showUnclassified;
viewer.setClassificationVisibility("1", showUnclassified);
}
var getQueryParam = function (name) {
name = name.replace(/[\[\]]/g, "\\$&");
var regex = new RegExp("[?&]" + name + "(=([^&#]*)|&|#|$)"),
results = regex.exec(window.location.href);
if (!results || !results[2]) return null;
return decodeURIComponent(results[2].replace(/\+/g, " "));
}
var r = getQueryParam('r');
if (r) {
name = r;
var http = 'http';
if (r.substr(0, http.length) == http) path = name;
else path = "./pointclouds/" + name + "/ept.json";
}
var c = getQueryParam('c');
Potree.loadPointCloud(path, name, function (e) {
viewer.scene.addPointCloud(e.pointcloud);
let material = e.pointcloud.material;
material.size = 1;
material.pointSizeType = Potree.PointSizeType.ADAPTIVE;
if (c) material.activeAttributeName = c;
viewer.fitToScreen(0.5);
});
</script>
</body>
</html>