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 badges1 Answer
Reset to default 8Take 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
版权声明:本文标题:javascript - Cesium: Dynamically Change Entity Position - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1741390516a2376077.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论