Updating a CZML property after the property is declared

Hello,

I'm trying to update some properties (namely semiMinorAxis and semiMajorAxis) from a packet previously declared. As such:

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

  {
  "id" : "ellipse_1",
  "name" : "ellipse_1 (61.0666922, -107.9917071)",
  "availability" : "2010-02-04T12:01:24Z/2010-02-04T12:05: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]
        }
      }
    }
  }
},

  {
  "id" : "ellipse_1"
  },
  "ellipse" : {
    "interval" : "2010-02-04T12:05:24Z/2010-02-04T12:05:00ZZ",
    "semiMinorAxis" : 600000,
    "semiMajorAxis" : 600000
  }
}
]

I am not able to load this in the viewer. Am I missing something obvious on how updating works in CZML files?

Thanks!

Hi there,

The syntax to update a czml object like this is the same as accessing any other javascript object values. Rather than trying to make another ellipse_1 object, overwrite using syntax like czml[2][‘ellipse’][‘height’] = 10.

Hope that helps,

  • Rachel

Hi Rachel,

Thanks a lot! The theory makes perfect sense to me, but the implementation is a different story :slight_smile: I’ll work on this and come back if I have more specific questions.

Cheers!

Rodolphe