my code:
<div id="cesiumContainer" style="width: 100%; height: 100vh;"></div>
<script type="module">
Cesium.Ion.defaultAccessToken = 'aaa';
// Initialize the Cesium Viewer in the HTML element with the `cesiumContainer` ID.
var viewer = new Cesium.Viewer('cesiumContainer');
// Fly the camera to San Francisco at the given longitude, latitude, and height.
viewer.camera.flyTo({
destination: Cesium.Cartesian3.fromDegrees(106.56901, 29.5139, 5000),
orientation: {
heading: Cesium.Math.toRadians(0.0),
pitch: Cesium.Math.toRadians(-40.0),
}
});
var tileset = viewer.scene.primitives.add(new Cesium.Cesium3DTileset({
url: 'mydata/3dtiles/tileset'
}));
</script>
</div>
I want to load a local 3dtiles file, but it never works. The Chrome browser does not report an error, and the data can be displayed when it is published to Cesium ion. I don’t know why. A similar loading method can load a json file successfully. There should be no problem with the path, and the data is only about 1.5M. who can help me solve this problem,thank you.