# How am i add the new Cesium.Cartesian3.fromDegreesArrayHeights or Coordinate in polyline Entity?

**URL:** <https://community.cesium.com/t/how-am-i-add-the-new-cesium-cartesian3-fromdegreesarrayheights-or-coordinate-in-polyline-entity/4761>\
**Category:** CesiumJS\
**Created:** [October 28, 2016, 7:09am UTC](https://community.cesium.com/t/how-am-i-add-the-new-cesium-cartesian3-fromdegreesarrayheights-or-coordinate-in-polyline-entity/4761 "2016-10-28T07:09:52Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![\_anjeev](https://avatars.discourse-cdn.com/v4/letter/_/ee7513/32.png) [@\_anjeev](https://community.cesium.com/u/_anjeev)\
**Post date:** [October 28, 2016, 7:09am UTC](https://community.cesium.com/t/how-am-i-add-the-new-cesium-cartesian3-fromdegreesarrayheights-or-coordinate-in-polyline-entity/4761/1 "2016-10-28T07:09:52Z")

</div>

At first time when i create entity of ployline :

var viewer = new Cesium.Viewer('cesiumContainer');  
var entities = viewer.entities;

var polylines = entities.add({  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;name : 'Line',  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;position : Cesium.Cartesian3.fromDegrees(-86.0, 55.0, 500000),  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;polyline : {  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;positions: Cesium.Cartesian3.fromDegreesArrayHeights([-86.0, 55.0, 500000]),  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;width : 1,  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;material : Cesium.Color.YELLOW  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}  
&nbsp;&nbsp;&nbsp;&nbsp;});

then i need to add another polyline positions when i get, so how i try :

var positions1 = new Cesium.Cartesian3.fromDegreesArrayHeights([-125, 43, 500000]);  
polylines.polyline.positions = positions1;

but its not working for me can you tell me what wrong am doing. please give me solution with sample code its help.

or any other way to do.

---

<div class="post-metadata">

**Author:** ![Abhishek\_Potnis](https://sea2.discourse-cdn.com/cesium/user_avatar/community.cesium.com/abhishek_potnis/32/3834_2.png) [@Abhishek\_Potnis](https://community.cesium.com/u/Abhishek_Potnis)\
**Post date:** [October 28, 2016, 8:53am UTC](https://community.cesium.com/t/how-am-i-add-the-new-cesium-cartesian3-fromdegreesarrayheights-or-coordinate-in-polyline-entity/4761/2 "2016-10-28T08:53:01Z")

</div>

Hi Sanjeev,

Please take a look at the Sandcastle example of Polylines: [http://cesiumjs.org/Cesium/Apps/Sandcastle/index.html?src=Polyline.html](http://cesiumjs.org/Cesium/Apps/Sandcastle/index.html?src=Polyline.html). It might help you out.

---

<div class="post-metadata">

**Author:** ![\_anjeev](https://avatars.discourse-cdn.com/v4/letter/_/ee7513/32.png) [@\_anjeev](https://community.cesium.com/u/_anjeev)\
**Post date:** [October 28, 2016, 10:58am UTC](https://community.cesium.com/t/how-am-i-add-the-new-cesium-cartesian3-fromdegreesarrayheights-or-coordinate-in-polyline-entity/4761/3 "2016-10-28T10:58:09Z")

</div>

Hello Abhishek Potnis,

i already seen the sandcastle example and its related but its not helpful to me.  
Actually i need a runtime updation of ployline Coordinate. When i get the data from my device than i want to put that coords to polyline entity.

if any this type of condition sample code was it, than post it.

Thx for reply.

---

<div class="post-metadata">

**Author:** ![Willem](https://avatars.discourse-cdn.com/v4/letter/w/898d66/32.png) [@Willem](https://community.cesium.com/u/Willem)\
**Post date:** [October 31, 2016, 8:37am UTC](https://community.cesium.com/t/how-am-i-add-the-new-cesium-cartesian3-fromdegreesarrayheights-or-coordinate-in-polyline-entity/4761/4 "2016-10-31T08:37:20Z")

</div>

Hi,

Take a look at PathGraphics; there you can use a Cesium.SampledPositionProperty() that allows you to add positions (with a timestamp).

Success, Willem
