0

I'm trying to update some properties (namely "semiMinorAxis" and "semiMajorAxis") from a packet previously declared in a czml file.

The way I attempt to do this, is by overwriting the values of "semiMinorAxis" and "semiMajorAxis".

That is: between 12:00:00 and 13:00:00, ellipse_1 has a size of 300000, and between 13:00:00 and 14:00:00, it has a size of 600000.

Here is how I'm trying to do this in a simple csml:

[
        {
        "id" : "document",
        "name" : "name",
        "version" : "1.0",
        "clock":
                {
                "interval": "2010-02-04T12:00:00Z/2010-02-04T14:00:00Z",
                "currentTime": "2010-02-04T12:00:00Z",
                        "multiplier": 100
                }
        },


        // I create ellipse_1
        {
        "id" : "ellipse_1",
        "name" : "ellipse_1 (61.0666922, -107.9917071)",
        "availability" : "2010-02-04T12:00:00Z/2010-02-04T13:00:00ZZ",
        "position" : {
                "cartographicDegrees" : [-107.9917071,61.0666922, 0.0]
        },
        "ellipse" : {
                "semiMinorAxis" : 300000,
                "semiMajorAxis" : 300000,
                "height" : 0.0,
                "material" : {
                        "solidColor" : {
                                "color" : {
                                        "rgba" :[151,20,150, 255]
                                }
                        }
                }
        }
},

        // I reuse the id and only change the values that I want the change
        {
        "id" : "ellipse_1"
        },
        "ellipse" : {
                "interval" : "2010-02-04T13:00:00Z/2010-02-04T14:00:00ZZ",
                "semiMinorAxis" : 600000,
                "semiMajorAxis" : 600000
        }
}
]

another option seems to be doing it this way:

{
    "id" : "ellipse_1",
    "name" : "ellipse_1 (61.0666922, -107.9917071)",
    "availability" : "2010-02-04T12:00:00.00Z/2010-02-04T14:00:00.00Z",
    "position" : {
        "cartographicDegrees" : [-137.9917071,51.0666922, 0.0]
    },
    "ellipse" : [
    {
        "interval" : "2010-02-04T12:00:00.00Z/2010-02-04T13:00:00.00Z",
        "semiMinorAxis" : 300000,
        "semiMajorAxis" : 300000,
        "height" : 200000.0,
        "material" : {
            "solidColor" : {
                "color" : {
                    "rgba" :[253,152,38, 255]
                }
            }
        }
    },
    {
            "interval" : "2010-02-04T13:00:00.00Z/2010-02-04T14:00:00.00Z",
            "semiMinorAxis" : 600000,
            "semiMajorAxis" : 600000,
            "height" : 200000.0,
            "material" : {
                "solidColor" : {
                    "color" : {
                        "rgba" :[253,152,38, 255]
                    }
                }
            }
        }
    ]
}

By the way, here is the script to view it:

<script>
    var viewer = new Cesium.Viewer('cesiumContainer', {
    imageryProvider : new Cesium.ArcGisMapServerImageryProvider({url : 'http://server.arcgisonline.com/ArcGIS/rest/services/World_Street_Map/MapServer'
    }),
    baseLayerPicker : false,
    animation : true,
    timeline : true,
    });

    var dataSourcePromise = Cesium.CzmlDataSource.load('../Apps/oscar.czml');
    viewer.dataSources.add(dataSourcePromise);    
    viewer.flyTo(dataSourcePromise).then(function(result){
    });
</script>

Unfortunately, these are clearly not the way to update values of an object in a csml file. Am I missing something obvious?

Thanks!

Lucien S.
  • 5,123
  • 10
  • 52
  • 88
  • Looks like you also asked this [on the forum](https://groups.google.com/forum/#!topic/cesium-dev/Cxo2EkXyT2I). Do you still need a response here? – emackey Aug 27 '17 at 16:12
  • Yes I do as the previous answer, although very competent didn't suffice to get me on the right track. Thanks! – Lucien S. Aug 28 '17 at 17:19

0 Answers0