Adding positions to polyline or wall

Folks,

How do we add positions to a polyline or wall? We want to show the path of a moving model.

Currently we are updating the wall with the complete path each time and this causes the wall to flicker.

Thanks

Ian

Hello Ian,

You might be able to use a path to accomplish this. Here is an example: http://cesiumjs.org/Cesium/Apps/Sandcastle/index.html?src=Interpolation.html&label=Showcases

Another solution would be to use a CallbackProperty for your positions. The flickering is happening because the wall is being drawn asynchronously. Using a CallbackProperty with isConstant set to false will make the wall draw synchronously.

See this forum post for an example: https://groups.google.com/d/msg/cesium-dev/nypZFdPLjhs/rRH_NdUvhVIJ

Best,

Hannah

Hannah,

Thanks for the idea.

We do not understand what triggers the CallbackProperty in the example. In our application we are currently updating an array of positons with the latest positon and then setting
the wall positons to this array which then makes the wall flicker.

How do we trigger the call to the CallbackProperty function? What we have is below, the flownPositionArray gets a new position added to it every second but the wall does not
get updated, if we call the drawFlightPathFlown3D directly the wall is drawn correctly but flickers.

flownWall = viewer.entities.add({

name: ‘Flown Wall’,

wall: {

//positions : new Cesium.CallbackProperty(drawFlightPathFlown, false),

material: Cesium.Color.GREEN.withAlpha(0.5),

// outline: true,

outlineColor: Cesium.Color.BLACK,

}});

function drawFlightPathFlown3D()

{

flownWall.wall.positions = flownPositionArray;

}

Thanks

Ian

On Behalf Of Hannah Pinkos

Your callback isn’t written correctly. You need to return a new value from it and let Cesium handle the assignment, not assign it directly to the target object.

Mark,

Thanks, that works and stops the flickering.

Ian

On Behalf Of Mark Erikson