CZML model Path disappears

Hi,

I am doing a czml with two paths, when the two paths do not end at the same time the model disappears. How can I fix it?

I use Sandcastle 1.37 for test. This is my code:

var czml = [{

“id” : “document”,

“name” : “CZML Path”,

“version” : “1.0”,

“clock”: {

“interval”: “2012-08-04T10:00:00Z/2012-08-04T10:02:00Z”,

“currentTime”: “2012-08-04T10:00:00Z”,

“multiplier”: 10,

“range” : “CLAMPED”,

“step” : “SYSTEM_CLOCK_MULTIPLIER”

}

}, {

“id” : “path”,

“name” : “path with GPS flight data”,

“description” : “

Hang gliding flight log data from Daniel H. Friedman.
Icon created by Larisa Skosyrska from the Noun Project

”,

“availability” : “2012-08-04T10:00:00Z/2012-08-04T10:02:00Z”,

“path” : {

“material” : {

“polylineOutline” : {

“color” : {

“rgba” : [255, 0, 255, 255]

},

“outlineColor” : {

“rgba” : [0, 255, 255, 255]

},

“outlineWidth” : 5

}

},

“width” : 8,

“leadTime” : 10,

“trailTime” : 1000,

“resolution” : 5

},

“model”: {

“gltf” : “…/…/SampleData/models/CesiumAir/Cesium_Air.glb”,

“scale” : 2.0,

“minimumPixelSize”: 128

},

“position” : {

“epoch” : “2012-08-04T10:00:00Z”,

“cartographicDegrees” : [

0,-122.93797,39.50935,1776,

10,-122.93822,39.50918,1773,

20,-122.9385,39.50883,1772,

30,-122.93855,39.50842,1770,

40,-122.93868,39.50792,1770,

50,-122.93877,39.50743,1767,

60,-122.93862,39.50697,1771,

70,-122.93828,39.50648,1765,

80,-122.93818,39.50608,1770,

90,-122.93783,39.5057,1754,

100,-122.93777,39.50513,1732

]

}

},{

“id” : “path2”,

“name” : “path with GPS flight data”,

“description” : “

Hang gliding flight log data from Daniel H. Friedman.
Icon created by Larisa Skosyrska from the Noun Project

”,

“availability” : “2012-08-04T10:00:00Z/2012-08-04T10:02:00Z”,

“path” : {

“material” : {

“polylineOutline” : {

“color” : {

“rgba” : [255, 0, 255, 255]

},

“outlineColor” : {

“rgba” : [0, 255, 255, 255]

},

“outlineWidth” : 5

}

},

“width” : 8,

“leadTime” : 10,

“trailTime” : 1000,

“resolution” : 5

},

“model”: {

“gltf” : “…/…/SampleData/models/CesiumAir/Cesium_Air.glb”,

“scale” : 2.0,

“minimumPixelSize”: 128

},

“position” : {

“epoch” : “2012-08-04T10:00:00Z”,

“cartographicDegrees” : [

0,-122.93197,39.50935,1776,

10,-122.93922,39.50918,1773,

20,-122.9395,39.50883,1772,

30,-122.93955,39.50842,1770,

40,-122.93968,39.50792,1770,

50,-122.93977,39.50743,1767,

60,-122.93962,39.50697,1771,

70,-122.93928,39.50648,1765,

80,-122.93918,39.50608,1770,

90,-122.93883,39.5057,1754,

100,-122.93877,39.50513,1732,

110,-122.9393,39.50458,1727,

120,-122.939815,39.50415,1717

]

}

}];

var terrainProvider = new Cesium.CesiumTerrainProvider({

url : ‘https://assets.agi.com/stk-terrain/v1/tilesets/world/tiles’,

requestVertexNormals : true

});

var viewer = new Cesium.Viewer(‘cesiumContainer’, {

terrainProvider : terrainProvider,

baseLayerPicker : false

});

viewer.dataSources.add(Cesium.CzmlDataSource.load(czml)).then(function(ds) {

viewer.trackedEntity = ds.entities.getById(‘path’);

});

``

Hello,

I added another item in the list of positions for the first path and that works:

var czml = [{

"id" : "document",

"name" : "CZML Path",

"version" : "1.0",

"clock": {

    "interval": "2012-08-04T10:00:00Z/2012-08-04T10:02:00Z",

    "currentTime": "2012-08-04T10:00:00Z",

    "multiplier": 10,

    "range" : "CLAMPED",

    "step" : "SYSTEM_CLOCK_MULTIPLIER" 

}

}, {

"id" : "path",

"name" : "path with GPS flight data",

"description" : "<p>Hang gliding flight log data from Daniel H. Friedman.<br>Icon created by Larisa Skosyrska from the Noun Project</p>",

"availability" : "2012-08-04T10:00:00Z/2012-08-04T10:02:00Z",

"path" : {

    "material" : {

        "polylineOutline" : {

            "color" : {

                "rgba" : [255, 0, 255, 255]

            },

            "outlineColor" : {

                "rgba" : [0, 255, 255, 255]

            },

            "outlineWidth" : 5

        }

    },

    "width" : 8,

    "leadTime" : 10,

    "trailTime" : 1000,

    "resolution" : 5

},

"model": {

    "gltf" : "../../SampleData/models/CesiumAir/Cesium_Air.glb",

    "scale" : 2.0,

    "minimumPixelSize": 128

},

"position" : {

    "epoch" : "2012-08-04T10:00:00Z",

    "cartographicDegrees" : [

        0,-122.93797,39.50935,1776,

        10,-122.93822,39.50918,1773,

        20,-122.9385,39.50883,1772,

        30,-122.93855,39.50842,1770,

        40,-122.93868,39.50792,1770,

        50,-122.93877,39.50743,1767,

        60,-122.93862,39.50697,1771,

        70,-122.93828,39.50648,1765,

        80,-122.93818,39.50608,1770,

        90,-122.93783,39.5057,1754,

        100,-122.93777,39.50513,1732,

        120,-122.93777,39.50513,1732

    ]

}

},{

"id" : "path2",

"name" : "path with GPS flight data",

"description" : "<p>Hang gliding flight log data from Daniel H. Friedman.<br>Icon created by Larisa Skosyrska from the Noun Project</p>",

"availability" : "2012-08-04T10:00:00Z/2012-08-04T10:02:00Z",

"path" : {

    "material" : {

        "polylineOutline" : {

            "color" : {

                "rgba" : [255, 0, 255, 255]

            },

            "outlineColor" : {

                "rgba" : [0, 255, 255, 255]

            },

            "outlineWidth" : 5

        }

    },

    "width" : 8,

    "leadTime" : 10,

    "trailTime" : 1000,

    "resolution" : 5

},

“model”: {

    "gltf" : "../../SampleData/models/CesiumAir/Cesium_Air.glb",

    "scale" : 2.0,

    "minimumPixelSize": 128

},

"position" : {

    "epoch" : "2012-08-04T10:00:00Z",

    "cartographicDegrees" : [

        0,-122.93197,39.50935,1776,

        10,-122.93922,39.50918,1773,

        20,-122.9395,39.50883,1772,

        30,-122.93955,39.50842,1770,

        40,-122.93968,39.50792,1770,

        50,-122.93977,39.50743,1767,

        60,-122.93962,39.50697,1771,

        70,-122.93928,39.50648,1765,

        80,-122.93918,39.50608,1770,

        90,-122.93883,39.5057,1754,

        100,-122.93877,39.50513,1732,

        110,-122.9393,39.50458,1727,

        120,-122.939815,39.50415,1717

        

    ]

}

}];

var terrainProvider = new Cesium.CesiumTerrainProvider({

url : ‘https://assets.agi.com/stk-terrain/v1/tilesets/world/tiles’,

requestVertexNormals : true

});

var viewer = new Cesium.Viewer(‘cesiumContainer’, {

terrainProvider : terrainProvider,

baseLayerPicker : false

});

viewer.dataSources.add(Cesium.CzmlDataSource.load(czml)).then(function(ds) {

viewer.trackedEntity = ds.entities.getById(‘path’);

});

I’m not sure why the model was disappearing in the first place though.

Thanks,

Gabby

Thanks, works fine.