# Adding positions to polyline or wall

**URL:** <https://community.cesium.com/t/adding-positions-to-polyline-or-wall/3936>\
**Category:** CesiumJS\
**Created:** [March 30, 2016, 11:44pm UTC](https://community.cesium.com/t/adding-positions-to-polyline-or-wall/3936 "2016-03-30T23:44:32Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![ianwalberg](https://sea2.discourse-cdn.com/cesium/user_avatar/community.cesium.com/ianwalberg/32/3476_2.png) [@ianwalberg](https://community.cesium.com/u/ianwalberg)\
**Post date:** [March 30, 2016, 11:44pm UTC](https://community.cesium.com/t/adding-positions-to-polyline-or-wall/3936/1 "2016-03-30T23:44:32Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![hannah](https://sea2.discourse-cdn.com/cesium/user_avatar/community.cesium.com/hannah/32/4509_2.png) [@hannah](https://community.cesium.com/u/hannah)\
**Post date:** [March 31, 2016, 3:00pm UTC](https://community.cesium.com/t/adding-positions-to-polyline-or-wall/3936/2 "2016-03-31T15:00:05Z")

</div>

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](http://cesiumjs.org/Cesium/Apps/Sandcastle/index.html?src=Interpolation.html&label=Showcases)

Another solution would be to use a [CallbackProperty](http://cesiumjs.org/Cesium/Build/Documentation/CallbackProperty.html) 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](https://groups.google.com/d/msg/cesium-dev/nypZFdPLjhs/rRH_NdUvhVIJ)

Best,

Hannah

---

<div class="post-metadata">

**Author:** ![ianwalberg](https://sea2.discourse-cdn.com/cesium/user_avatar/community.cesium.com/ianwalberg/32/3476_2.png) [@ianwalberg](https://community.cesium.com/u/ianwalberg)\
**Post date:** [March 31, 2016, 10:55pm UTC](https://community.cesium.com/t/adding-positions-to-polyline-or-wall/3936/3 "2016-03-31T22:55:34Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![Mark\_Erikson](https://sea2.discourse-cdn.com/cesium/user_avatar/community.cesium.com/mark_erikson/32/2024_2.png) [@Mark\_Erikson](https://community.cesium.com/u/Mark_Erikson)\
**Post date:** [April 1, 2016, 3:24am UTC](https://community.cesium.com/t/adding-positions-to-polyline-or-wall/3936/4 "2016-04-01T03:24:32Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![ianwalberg](https://sea2.discourse-cdn.com/cesium/user_avatar/community.cesium.com/ianwalberg/32/3476_2.png) [@ianwalberg](https://community.cesium.com/u/ianwalberg)\
**Post date:** [April 1, 2016, 10:03am UTC](https://community.cesium.com/t/adding-positions-to-polyline-or-wall/3936/5 "2016-04-01T10:03:25Z")

</div>

Mark,

Thanks, that works and stops the flickering.

Ian

**On Behalf Of** Mark Erikson
