CZML format and labels

586 views
Skip to first unread message

PC

unread,
Jan 16, 2013, 8:54:58 AM1/16/13
to cesiu...@googlegroups.com
I've been working with CZML to display a list of polygons. Everything seemed to work until I got into trying to label my polygons described in the CZML. For some reason, I can't seem to label them correctly in the CZML so that the label shows up on the Cesium globe. I am not using billboards in my CZML or any element of time. However, based on the CZML examples and the documentation I believe it is still possible to include a label property and see it show up with the associated polygon via CZML.

Is this true?
Would somebody be willing to provide me a CZML example (not using billboards or time) that would work with labels?

Thanks in advance for any help.

- Paul

Matthew Amato

unread,
Jan 18, 2013, 11:29:24 AM1/18/13
to cesiu...@googlegroups.com, prcol...@gmail.com
Paul,

Here's a snippet that puts a label at the provided position.  No time or billboard involved.  I grabbed this from our simple.czml example in Apps/CesiumViewer/Gallery/

{
    "id":"/Application/STK/Scenario/simple/Facility/AGI",
    "label":{
      "fillColor":{
        "rgba":[
          0,255,255,255
        ]
      },
      "font":"10pt Lucida Console",
      "horizontalOrigin":"LEFT",
      "outlineColor":{
        "rgba":[
          0,0,0,255
        ]
      },
      "pixelOffset":{
        "cartesian2":[
          12.0,0.0
        ]
      },
      "scale":1.0,
      "show":true,
      "style":"FILL",
      "text":"AGI",
      "verticalOrigin":"CENTER"
    },
    "position":{
      "cartesian":[
        1216469.9357990976,-4736121.71856379,4081386.8856866374
      ]
    }
  }

I hope that helps.

Matt
Reply all
Reply to author
Forward
0 new messages