Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
Jeyaram
Visualization
Commits
2158f0da
Commit
2158f0da
authored
May 04, 2022
by
Joe TS Dell
Browse files
update
parent
2aee5012
Changes
1
Hide whitespace changes
Inline
Side-by-side
example.html
0 → 100644
View file @
2158f0da
<html
lang=
"en"
>
<head>
<meta
charset=
"utf-8"
>
<script
src=
"https://cesium.com/downloads/cesiumjs/releases/1.92/Build/Cesium/Cesium.js"
></script>
<link
href=
"https://cesium.com/downloads/cesiumjs/releases/1.92/Build/Cesium/Widgets/widgets.css"
rel=
"stylesheet"
>
</head>
<body>
<div
id=
"cesiumContainer"
style=
"width: 100%; height:100%"
></div>
<script>
// Cesium.Ion.defaultAccessToken = '
<
Your
Access
Token
Here
>
'
;
var viewer = new Cesium.Viewer(
'
cesiumContainer
'
, {
baseLayerPicker: true,
vrButton: true,
geocoder: false,
navigationHelpButton: false,
selectionIndicator: false,
shadows: true,
timeline: true,
sceneModePicker: true,
});
var tileset = viewer.scene.primitives.add(new Cesium.Cesium3DTileset({
url: "tileset/tileset.json"
}))
Cesium.when(tileset.readyPromise).then(function (tileset) {
viewer.flyTo(tileset)
var heightOffset = -20.0;
var boundingSphere = tileset.boundingSphere;
var cartographic = Cesium.Cartographic.fromCartesian(boundingSphere.center);
var surface = Cesium.Cartesian3.fromRadians(cartographic.longitude, cartographic.latitude, 0.0);
var offset = Cesium.Cartesian3.fromRadians(cartographic.longitude, cartographic.latitude,
heightOffset);
var translation = Cesium.Cartesian3.subtract(offset, surface, new Cesium.Cartesian3());
tileset.modelMatrix = Cesium.Matrix4.fromTranslation(translation);
})
</script>
</body>
</html>
\ No newline at end of file
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment