Hello,
I am encountering an issue with using Cesium in my project and I hope you can help me resolve it. Here are the details of the error I am receiving:
An error occurred while rendering. Rendering has stopped.
TypeError: (window.URL || window.webkitURL).createObjectURL is not a function
TypeError: (window.URL || window.webkitURL).createObjectURL is not a function
at getWorkerUrl (https://cesium.com/downloads/cesiumjs/releases/1.88/Build/Cesium/Cesium.js:43:150996)
at getBootstrapperUrl (https://cesium.com/downloads/cesiumjs/releases/1.88/Build/Cesium/Cesium.js:43:151116)
at createWorker (https://cesium.com/downloads/cesiumjs/releases/1.88/Build/Cesium/Cesium.js:43:151233)
at TaskProcessor.scheduleTask (https://cesium.com/downloads/cesiumjs/releases/1.88/Build/Cesium/Cesium.js:43:153019)
at HeightmapTerrainData.createMesh (https://cesium.com/downloads/cesiumjs/releases/1.88/Build/Cesium/Cesium.js:43:162556)
at transform (https://cesium.com/downloads/cesiumjs/releases/1.88/Build/Cesium/Cesium.js:50:2506245)
at processTerrainStateMachine (https://cesium.com/downloads/cesiumjs/releases/1.88/Build/Cesium/Cesium.js:50:2500668)
at GlobeSurfaceTile.processStateMachine (https://cesium.com/downloads/cesiumjs/releases/1.88/Build/Cesium/Cesium.js:50:2503919)
at GlobeSurfaceTileProvider.loadTile (https://cesium.com/downloads/cesiumjs/releases/1.88/Build/Cesium/Cesium.js:50:2552635)
at processSinglePriorityLoadQueue (https://cesium.com/downloads/cesiumjs/releases/1.88/Build/Cesium/Cesium.js:50:2609509)
Context:
- Web Server: WAMP64 with Apache.
- Environment: Windows 11.
- Cesium Version: 1.88 (also tried with 1.70).
Issue Description:
I have placed my HTML and JavaScript files in the www/thomas
directory of my WAMP installation. When I load my page, the Cesium interface displays correctly, but no map is rendered. The error mentioned above appears in the browser console, indicating that the createObjectURL
method is not available or not working properly.
What I’ve Tried So Far:
- Using Different Versions of Cesium: I have tried with versions 1.70 and 1.88, but the issue persists.
- Configuring External Workers: I have configured Cesium to use external workers by setting
Cesium.buildModuleUrl.setBaseUrl
. - Launching WAMP and Checking the Directory: My files are correctly placed in
C:\wamp64\www\thomas\
.
Code Snippets:
document.addEventListener(‘DOMContentLoaded’, function () {
Cesium.Ion.defaultAccessToken = ‘your_access_token_here’;
Cesium.buildModuleUrl.setBaseUrl('https://cesium.com/downloads/cesiumjs/releases/1.70/Build/Cesium/');
try {
const viewer = new Cesium.Viewer('cesiumContainer', {
imageryProvider: Cesium.createWorldImagery(),
baseLayerPicker: false,
scene3DOnly: true
});
const tileset = new Cesium.Cesium3DTileset({
url: 'http://localhost/thomas/tileset/tileset.json'
});
viewer.scene.primitives.add(tileset);
viewer.zoomTo(tileset);
console.log("Cesium viewer initialized");
} catch (error) {
console.error("Error initializing Cesium:", error);
}
});
I would appreciate any guidance you can provide to help me understand why this error is occurring and how I can fix it. Is there something specific I need to do to ensure createObjectURL
works correctly in my environment?
Thank you in advance for your help.
Best regards,
Thomas.