-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.html
67 lines (50 loc) · 1.62 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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<link href="https://cesium.com/downloads/cesiumjs/releases/1.124/Build/CesiumUnminified/Widgets/widgets.css" rel="stylesheet">
<style>
html, body {
margin: 0;
padding: 0;
}
#cesiumContainer {
height: 100%;
}
</style>
</head>
<body>
<div id="cesiumContainer"></div>
<script type="module">
import {
Viewer, Ion, Ellipsoid,
Cesium3DTileStyle, Cesium3DTileset,
VerticalOrigin, HorizontalOrigin, Cartographic,
BoundingSphere, HeadingPitchRange, LabelStyle,
TileCoordinatesImageryProvider,
createDefaultImageryProviderViewModels
}
// from "/lib/Cesium/Build/CesiumUnminified/index.js"
from "https://cesium.com/downloads/cesiumjs/releases/1.124/Build/CesiumUnminified/index.js"
const TSET_URL = "data/pnts-implicit.json";
const TSET_STYLE_URL = "data/city-labels-style.json";
const models = createDefaultImageryProviderViewModels();
const esriWorldImagery = models.find(p => p.name === 'ArcGIS World Imagery');
const viewer = new Viewer('cesiumContainer', {
selectedImageryProviderViewModel: esriWorldImagery,
imageryProviderViewModels: models,
msaaSamples: 1
});
await addTileset();
async function addTileset() {
const response = await fetch(TSET_STYLE_URL);
const styleJson = await response.json();
const style = new Cesium3DTileStyle(styleJson);
const tset = await Cesium3DTileset.fromUrl(TSET_URL);
viewer.scene.primitives.add(tset);
tset.style = style;
}
</script>
</div>
</body>
</html>