Monthly Archives: September 2015

Cesiumjs – How to draw a polyline from one height to the next.



Cesiumjs – How to draw line slowly and stop on left click.




Cesiumjs – Hooks buttons or any other control into the Cesium Viewer toolbar.


Hooks buttons or any other control into the Cesium Viewer toolbar.


Cesiumjs – How to set default imagery provider.


If you want to use the BaseLayerPicker, then you need to specify what imagery and terrain seletions are available. It’s more code bu just as straight forward. Here’s a full example that adds two possible terrains and 2 possible imagery providers. It makes the second one active by default by setting the selectedXXX properties, otherwise the first index would be active instead.


cesiumjs – How to flies to an entity and create marker.

Flies to an entity (marker) then tracks it without the camera jumping

How to zoom in about 1000 meters above it ?
I would like to now get the position of the entity (used in the onTick), and then pass this to the camera, lookAt function.

entity.position() provides me info, but I am not sure how I can use this to pass it to the lookAt function.

The first argument is the pin position. The second argument is a Cartesian3 offset in the pin’s reference frame, so z=1000 puts the camera 1000m above the pin.


cesiumjs – How to access folder from KML file and parse.

How to access from KML file and parse to make folder structure.

KML file


Cesiumjs – How to access the coordinates


Those coordinates are given in radians. You can convert them back to degrees with Cesium.Math.toDegrees(radianValue).


Cesiumjs – Show and hide multiple entity/labels

How can i toggle multiple labels/entities ?



cesiumjs – How to Make Multicolor Polyline

How does segmenting a polyline into different colors work.



How to enable cross-origin resource sharing using php

I was working on parsing KML data file from different resources which had different urls and Cesiumjs was unable to read/parse, that is how i come to know enabling cross-origin resource sharing.
It is also called CORS. Here is more details .

Following these steps you can enable “CORS”.
1. First check if you have apache module installed, using php.

2. Use command line to check if you have “Access-Control-Allow-Origin: *”

3. If you don’t see this line “Access-Control-Allow-Origin: *” in curl -I output you need to add and enable it in either in PHP file ot .htacces file.

4. Now its time to add code and enable your missing part!

In .htaccess

In PHP file

After that you need to test using

You must see Access-Control-Allow-Origin: *” with headers.