admin管理员组

文章数量:1289556

I'm drawing an entity using position data being fed from a database.

I'm currently using

viewer.entities.removeAll();

to remove all the entities every time I get a result from the database.

This causes a long and heavy process in the browser as the entities are currently 3D models.

Is there a better way for the data to update, for example an array of the entities.

Or a way to cache the entities that I could then alter the data.

The end result is so that I could alter the positions on the fly and then see the entity update on the display

I am using

viewer.entities.add({
            name : name,
            position : position,
            orientation : orientation,
            model : {
                uri : url,
                minimumPixelSize : 50
            }
        });

to add the entities

I'm drawing an entity using position data being fed from a database.

I'm currently using

viewer.entities.removeAll();

to remove all the entities every time I get a result from the database.

This causes a long and heavy process in the browser as the entities are currently 3D models.

Is there a better way for the data to update, for example an array of the entities.

Or a way to cache the entities that I could then alter the data.

The end result is so that I could alter the positions on the fly and then see the entity update on the display

I am using

viewer.entities.add({
            name : name,
            position : position,
            orientation : orientation,
            model : {
                uri : url,
                minimumPixelSize : 50
            }
        });

to add the entities

Share Improve this question edited Sep 18, 2015 at 15:06 Beshman88 asked Sep 18, 2015 at 8:08 Beshman88Beshman88 651 gold badge1 silver badge9 bronze badges
Add a ment  | 

1 Answer 1

Reset to default 8

Take a look at the Picking Demo, you can see it assigning new Cartesian3 values to entity.position around line 26 in the live-editor window. Updating an entity is going to be much faster than destroying it and creating a new one.

Also, if your database knows that an entity has a position that changes over time, you can supply that via a SampledPositionProperty, and allow Cesium to animate the entity moving along a path over time.

本文标签: javascriptCesium Dynamically Change Entity PositionStack Overflow