Hello !
I’m using Cesium 1.130 in an Angular 20 project.
I’d like my Cesium viewer to work entirely offline, without fetching any imagery, tiles, or other resources from the internet.
My goal is to display a GeoJSON map that contains countries and continents (a standard GeoJSON format, which loads correctly and displays all the polygons).
That part works fine — I can see all the countries rendered on the globe.
But, I can’t see my entities appear on the map.
Cesium.Ion.defaultServer = '';
const defaultOptions: Cesium.Viewer.ConstructorOptions = {
terrainProvider: new Cesium.EllipsoidTerrainProvider(),
timeline: isShowingMapTimeLine,
animation: isShowingAnimation,
geocoder: false,
baseLayer: false,
// Disable useless button
baseLayerPicker: false,
homeButton: false,
sceneModePicker: false,
navigationHelpButton: false,
fullscreenButton: false
}
const mergedOptions = { ...defaultOptions, ...options };
this.viewer = new Cesium.Viewer(containerId, mergedOptions);
this.viewer.scene.globe.baseColor = Cesium.Color.fromCssColorString('#202020');
this.viewer.scene.requestRenderMode = true;
Cesium.GeoJsonDataSource.load('geojson/countries.geojson',
{
fill: Cesium.Color.fromCssColorString('#f70000'),
stroke: Cesium.Color.WHITE
}).then(res => {
this.viewer!.dataSources.add(res);
console.log('Cesium Viewer initialized.');
// Remove cesium ion logo
this.viewer!.cesiumWidget.creditContainer?.parentNode?.removeChild(this.viewer!.cesiumWidget.creditContainer);
// Set camera view (show france)
this.viewer!.camera.setView({
destination: Cesium.Rectangle.fromDegrees(-10, 35, 20, 52),
orientation: {
heading: Cesium.Math.toRadians(0.0)
}
});
this.viewerInitializedSubject.next(true);
});
If I comment this line:
this.viewer!.dataSources.add(res);
My entities appear.
How can I show my geojson datas and all my entities please ?
Thank you very much in advance!