Problems to load geojson

Sorry if this questions is so basic.
I´d try to create an webpage using this example: https://cesium.com/docs/tutorials/getting-started/
And I used a camera fly like the examples in Sandcastle.
Now i´d try to load a geojson and show it in the webpage, and thats something i could do.
I´ve tried a lot of ways, but I cannot do it.
I show my code
Can someone help me?
Thanks for your help!

var dS = Cesium.GeoJsonDataSource.load(‘geojson/RedHidro.geojson’);
viewer.dataSources.add(dS);

Welcome to the Cesium community!

Are you creating your application in Glitch as that tutorial describes? If so, you’ll need to upload your GeoJSON somewhere so your application can access it. The easiest way to do that is to upload it to Cesium ion. Then you’ll see a Open complete code example button in your preview window in Cesium ion that’ll show you the code you need to add to your project:

Let me know if that works for you.

Thanks for your answer.
But if the app is offline, and I wanna load the geojson from my computer?

You can load local files to CesiumJS as long as they’re served from a local HTTP server. This article is a good reference on this: https://developer.mozilla.org/en-US/docs/Learn/Common_questions/set_up_a_local_testing_server.

1 Like

Thanks for your help!