Hello,
I’m using CESIUM JS (1.124.0) in my Angular 19 project.
When I start my application, I get an API call:
Response: https://api.cesium.com/v1/assets/2/endpoint?access_token: {“code”: “INVALID_TOKEN”, “message”: “Invalid access token”}
I’m using Cesium without ION, so I don’t understand the purpose of this message. Here’s how I integrate Cesium. Do I need to add an option? Thanks in advance for your help!
this.mapViewerService.initializeViewer('cesiumContainer', {
terrainProvider: new Cesium.EllipsoidTerrainProvider(),
timeline: this.isShowingMapTimeLine,
animation: this.isShowingAnimation,
geocoder: false,
// Disable useless button
baseLayerPicker: false,
homeButton: false,
sceneModePicker: false,
navigationHelpButton: false
});
/**
* Initialize the Cesium Viewer
* @param containerId The ID of the DOM container for the Cesium viewer
* @param options Optional Cesium Viewer options
*/
initializeViewer(containerId: string, options?: Cesium.Viewer.ConstructorOptions) {
if (this.viewer) {
console.warn('Cesium Viewer is already initialized.');
} else {
this.viewer = new Cesium.Viewer(containerId, options);
console.log('Cesium Viewer initialized.');
this.viewerInitializedSubject.next(true);
// Remove cesium ion logo
this.viewer.cesiumWidget.creditContainer?.parentNode?.removeChild(this.viewer.cesiumWidget.creditContainer);
// Add imagery
this.viewer.imageryLayers.addImageryProvider(new Cesium.UrlTemplateImageryProvider({ url: 'https://a.tile.openstreetmap.org/{z}/{x}/{y}.png' }))
// Set camera view (show france)
this.viewer.camera.setView({
destination: Cesium.Rectangle.fromDegrees(-10, 35, 20, 52),
orientation: {
heading: Cesium.Math.toRadians(0.0)
}
});
}
}