Load CZML file into Cesium - problem

Hi,

I would like to add example.czml file to the viewer. After open the Cesium I don’t get any effect and errors. Below example of my code.

I add only that, when I write code from example.czml file as script in index.html file (var czml = […] and then CzmlDataSource.load(czml) ) everything works ok.

example.czml file -

[

{

“id” : “document”,

“name” : “Wstrzasy”,

“version” : “1.0”

}, {

“id” : “Wstrzas_1”,

“availability”: “2017-01-02T00:00:01Z/2017-01-02T23:59:00Z”,

“name” : “Wstrzas_1”,

“description”: “

To jest kulka

Magnitiuda: 3.3

”,

“position” : {

“cartographicDegrees” : [18.9144, 50.2368, 100]

},

“model”: {

“gltf” : “…/data/Kula.glb”,

“scale” : 3.3,

“minimumPixelSize”: 64

},

},{

“id” : “Wstrzas_2”,

“availability”: “2017-01-03T00:00:01Z/2017-01-03T23:59:00Z”,

“name” : “Wstrzas_2”,

“description”: “

To jest kulka

Magnitiuda: 2.6

”,

“position” : {

“cartographicDegrees” : [19.0407, 50.2295, 100]

},

“model”: {

“gltf” : “…/data/Kula.glb”,

“scale” : 2.6,

“minimumPixelSize”: 64

},

}

]

and code from my index.html file -

Can anybody tell what is wrong? I’m new in using CZML files.

Thanks for help.

Lukas

One more question, is there any way to show all objects from czml file independent from “availiability” parameter? I mean, how to show all objects when time slider will be e.g. on the end of time line

Hi Lucas,

If it works when you paste it in index.html, then it is most likely valid CZML. Make sure you are serving your file from a web server and you are loading the correct url.

If you want to show all of your CZML entities all the time, you can remove the “availability” field entirely. More info is available in the CZML Guide about availability.

Thanks,

Gabby