# Problems in drawing flight path

**URL:** <https://community.cesium.com/t/problems-in-drawing-flight-path/2579>\
**Category:** CesiumJS\
**Created:** [May 31, 2015, 9:48am UTC](https://community.cesium.com/t/problems-in-drawing-flight-path/2579 "2015-05-31T09:48:00Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![shevachen07](https://avatars.discourse-cdn.com/v4/letter/s/58f4c7/32.png) [@shevachen07](https://community.cesium.com/u/shevachen07)\
**Post date:** [May 31, 2015, 9:48am UTC](https://community.cesium.com/t/problems-in-drawing-flight-path/2579/1 "2015-05-31T09:48:00Z")

</div>

I want to make a flight path in Cesium just like this one  
[http://www.senchalabs.org/philogl/PhiloGL/examples/worldFlights/](http://www.senchalabs.org/philogl/PhiloGL/examples/worldFlights/)  
If i use the polyline, the routes will stuck on the ground, I want to make flight path in air, Could you show me the code about the drawing line function. Thank you!

---

<div class="post-metadata">

**Author:** ![Scott\_Reynolds](https://sea2.discourse-cdn.com/cesium/user_avatar/community.cesium.com/scott_reynolds/32/2014_2.png) [@Scott\_Reynolds](https://community.cesium.com/u/Scott_Reynolds)\
**Post date:** [June 1, 2015, 3:24pm UTC](https://community.cesium.com/t/problems-in-drawing-flight-path/2579/2 "2015-06-01T15:24:11Z")

</div>

You’ll want to use [Path](http://cesiumjs.org/Cesium/Build/Documentation/PathGraphics.html)rather than Polyline. Here’s the idea using an [Entity](http://cesiumjs.org/Cesium/Build/Documentation/Entity.html).

var viewer = new Cesium.Viewer(‘cesiumContainer’);

viewer.clock.startTime = Cesium.JulianDate.fromIso8601(“2014-03-14T00:00:00.000Z”);

viewer.clock.stopTime = Cesium.JulianDate.fromIso8601(“2014-03-15T00:00:00.000Z”);

viewer.clock.currentTime = Cesium.JulianDate.fromIso8601(“2014-03-14T00:00:00.000Z”);

viewer.clock.clockRange = Cesium.ClockRange.LOOP\_STOP;

var entities = viewer.entities;

var flights = entities.add(new Cesium.Entity());

var aircraftPositions = new Cesium.SampledPositionProperty();

aircraftPositions.addSample(“2014-03-14T16:00:00.000”, Cesium.Cartesian3.fromDegrees(-80.000, 28.400, 0.000));

var aircraft = entities.add({

parent: flights,

name: “XYX1308”,

description: “A flight roughly from Florida to Ireland.”,

position: aircraftPositions,

orientation: new Cesium.VelocityOrientationProperty(aircraftPositions),

path: {

leadTime: 86400.0,

trailTime: 86400.0,

width: 2.0,

material: Cesium.Color.DODGERBLUE

}

});

``

I’ve also attached a full Sandcastle example.

Scott

[Forum\_ProblemsInDrawingFlightPath.js](https://community.cesium.com/uploads/short-url/A11JpKecZB7aB7bnVTAdWoh4x6g.js) (33 KB)

---

<div class="post-metadata">

**Author:** ![lalit\_verma](https://avatars.discourse-cdn.com/v4/letter/l/ecccb3/32.png) [@lalit\_verma](https://community.cesium.com/u/lalit_verma)\
**Post date:** [October 19, 2015, 3:06pm UTC](https://community.cesium.com/t/problems-in-drawing-flight-path/2579/3 "2015-10-19T15:06:09Z")

</div>

Hi Scott,

I have to do the same thing, but I don’t want to use viewer. As I am using trackingView of earth. Could you help me. Please.

Thank you in advance.

Best Regards,

Lalit
