The problem is when I loading terrain to CesiumTerrainProvider in viewer, I got an error occurred “Zh” Failed to obtain terrain tile X:0 Y:0 Level: 0. Error Message: Range Error: Invalid typed array length 8894653434”.
I tried 2 option to create terrain files. The first one is Package ctb-quantized-mesh · GitHub which can create layer.json. The second is homme/cesium-terrain-builder:latest. Both of the options give same error. I am working in offline environment. And my viewer is:
new Viewer(“cesiumContainer”, {
imageryProvider: ImageryLayer.fromProviderAsync(
TileMapServiceImageryProvider.fromUrl(
buildModuleUrl(“Assets/Textures/NaturalEarthII/”)
)
),
terrainProvider: CesiumTerrainProvider.fromUrl(http://localhost:8000/terrain/tiles/,{
requestVertexNormals: true,
}),
baseLayerPicker: false,
geocoder: false,
homeButton: false,
infoBox: false,
scaneModePicker: true,
selectionIndicator: false,
timeline: true,
creditContainer: document.createElement(“none”)
})
Also my terrain folder is
→ 0
→ 0
→ 0.terrain
->1
→ 0.terrain
→ 1
->2
→ 1.terrain
.
.
.
layer.json
Note: http://localhost:8000 I used python http server with necessary CORS configuration
Note: All files in http://localhost:8000 are accessible from local.