1. A concise explanation of the problem you're experiencing.
I'm new to Cesium and I have some basic questions about loading geojson data. I'm assuming the file can be located on the client and loaded by javascript. But what is the path used for loading relative to? I've put my geojson file in the root directory of my app but my app still can't find the file. The actual error message I get is: 'SyntaxError: Unexpected token < in JSON at position 0.' But it's valid json and gives me that message no matter what I set the path to, even if I delete the file
2. A minimal code example. If you've found a bug, this helps us reproduce and repair it.
Cesium.GeoJsonDataSource.load('./map.geojson');
3. Context. Why do you need to do this? We might know a better way to accomplish your goal.
I want to load a file with the country shapes that I can color and label as desired.
4. The Cesium version you're using, your operating system and browser.
I think this might be an issue in how you have your app set up. Can you try loading any of the sample data that comes with Cesium in the same way, locally, and see if it works?
Thanks for your response. I ultimately got it to work by just wrapping it in a function and changing the file to be a .js file. Exported the function, then imported the file where I needed it and called the function. Worked fine. I never could figure out to do it by passing a string like so:
Cesium.GeoJsonDataSource.load('./map.geojson');
I wondered if it was a file access issue too, but after a while, I concluded that it just couldn't find it and the error message was very unhelpful. I'm developing this in Meteor and I just can't figure out what the "context" is for that load function above.