Calculate km CZML path


I was looking at this example,

but this is for a polyline, how can I do it for CZML.

I want to show the km of the path in a label as in the following image.


Hi there,

Once your CZML s loaded, you can use either EllipsoidGeodesic ( or the distance function in Cartesian3 ( to measure length, depending if you want to measure distance along the ellipsoid surface or just point to point.

Cesium loads all data as Entities, so it’s just a matter of getting the point data (your CZML may just load a polyline!) and measuring using one of the above methods.

Hope that helps,

  • Rachel