Entity Duplication

I’m trying to update an entity that I’ve added to viewer.entities, and it seems to be periodically duplicating the entity as the scene renders. Here’s an example using the Sandcastle Circles and Ellipses demo. Just add this to the bottom and run it:

var radius = 300000;
setInterval(function() {
redEllipse.ellipse.semiMajorAxis = radius;
redEllipse.ellipse.semiMinorAxis = radius;

radius += 1000;

}, 100);

``

Duplication seems to happen most when zooming in on it while it’s updating. Am I doing something unsupported here?

Thanks,

Jon

Thanks for the bug report. I’ve seen this recently as well and it’s definitely a bug.

One thing I will mention is that if you are animating entities then you’ll want to use a corresponding time-dynamic property rather than just keep setting new constant values. For example, SampledProperty or CallbackProperty. This is an area where doc is lacking in Cesium, but I’m planning a tutorial on using the time-dynamic aspects of Cesium some time soon, so keep an eye out for it. If you can provide some more info on your use case, I can probably make some suggestions in the mean time.

I’m trying to support drawing an entity by clicking and dragging. Any ideas?

Check out this demo: http://analyticalgraphicsinc.github.io/cesium-google-earth-examples/demos/draw/

You basically click once to start drawing, then click again to complete the polyline.

It is one of our Google Earth ports: https://github.com/AnalyticalGraphicsInc/cesium-google-earth-examples

It uses a callback property while it’s updating so that the geometry is treated as dynamic. Then once editing is done, it stores the final values as static.

There’s definitely room for improvement in the entity API in this area; but writing an interactive editor should be possible with what’s currently there.

Thanks, that works well.

Only issue is that it seems like it takes about 4 static entities before Cesium is “warmed up”, otherwise there is a lag between finishing the draw and displaying the new static entity. If I use minified source, the lag is only about half a second so it’s not much of an issue, but in development it can be a few seconds. Seems to be related to the number of cesiumWorkerBootstrapper threads active. Once it hits 5 threads, the lag goes away. If I tell Cesium the static entity has dynamic callback properties, the lag also goes away.

Hello,

Just to add my voice on this one… i think i am seeing the same bug. I have a transparency slider where i do this:

var color = entity.polygon.material.color.getValue();
color.alpha = opacity;
entity.polygon.material.color.setValue(color);


as the slider moves (with varying values for ‘opacity’)… it works 90% of the time but occasionally (after ~20 secs of playing with the slider) i am seeing duplicate entities appearing in scene.primitives.

i’m struggling to produce a sandcastle to reproduce this unfortunately. could it be related to the same problem ?

-i

The fix for this problem will be in 1.7, coming out later today.

hello,

i can confirm that in 1.7 we no longer have the duplication problem.

awesome work, as always.

-i