I would like to update the location of a shape that has been added to a primitive, without removing and re-adding it. Is there a way to programmatically access the position of an instance within the primitive collection?
The gist of what I'm trying to do is:
updateEllipse = function( position, index )
{
position.lat = position.lat + 20;
position.lon = position.lon - 10;
var p = this.engine.viewer.scene.primitives.get(index);
this.engine.viewer.scene.primitives[index].positions = position;
/*{ lat : position.lat,
lon : position.lon
};*/
};
Is there a way to access the coordinates and update them on the fly? Or should the features be added to the scene as a different type of object?
Thanks!