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

At first time when i create entity of ployline :

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

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

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.

Hi Sanjeev,

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

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.

Hi,

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

Success, Willem