How to dynamicaly update polygons with the new Geometry layer ?


I use PolylineCollection to create and dynamicly update polylines positions several time by seconds.

I would like to do the same with filled polygons. I saw that in b20 it was not so easy :!topic/cesium-dev/rwVRd65ohxw

I also know that there still isn't PolygonCollection now, but was wondering if there is an easier way to update my polygons positions in the current head version ?

I think I can't use datasources, as my polygons are not time pre-computable, I just compute the positions on the fly, from differents inputs, user input is one of them.


You can use Polygon, which is a wrapper over the geometry. Just a heads up that we are doing some API cleanup over the next two months that might change or remove this class, but something very similar will replace it.


Hi Patrick,

I didn't mentioned it, but I'm already using Cesium.Polygon. The problem is that the update() of that class seams to re-create a new geometry every time it's updating, instead of editing the underlaying VAO/VBO.

At the rate I'm modifying the positions (several time a second), the shape is blinking.

That's why I was wondering if there was not an API way to access the VBO and edit it to have a smooth rendering.

Also, I'm using b27 rigth now, maybe this update method changed in b29, or it will change in the new API you talked about?

Tanks for your time,

When you construct the Polygon, include “asynchronous : false” in the constructor and the blinking will go away.

The geometry layer is meant for static data so if performance is still not good enough, you can try to roll your own rendering code that streams into the vertex buffer directly or wait for Cesium dynamic buffers (#932), which will be higher level and nearly as fast. This is one of the most requested Cesium features and we plan to get to it once we are done stabilizing the Cesium API this summer.


Very cool I look forward to it !
again, thank you for your work :slight_smile:

Hey everyone,

i have a possibly related problem in b28. Is there a way to get rid of the blinking using czml? When using paths in czml there is no blinking, but unfortunately polylines always blink. I am also doing very frequent updates on them from an external application using czml, so this is a real problem for me. I have a minimal example for this problem in the cesium sandbox available, what is the policy for submitting code in this list? Pastebin? Attachment? In-Line?

Besides this problem, when first adding a polyline using czml it seems to take a long while (>5-10s here) until it is displayed… I didn’t check that in other browsers or on other machines though.

Cheers, and thnx for the great work!


here is the sandbox code that reproduces the problems for me. I saw other people posting attachments, so I guess it is okay. After loading the contents from the attached file in the sandbox just click on the polyline example, wait for the polyline to appear (takes some time) and press the button multiple times afterwards. You will see the mentioned flickering of the polyline.


czmlsandboxcode.txt (3.28 KB)