Category Archives: cesiumjs

Cesium – How to show pyramid with polygon base in CZML ?

Share

Cesium – How to show multiple polylines using czml ?

By : https://github.com/AnalyticalGraphicsInc/cesium/issues/3598

Share

Cesium – How to make an InfoBox pop up on demand ?

It’s a bit of a hack, but you can make the info popup display whatever you like by creating a fake entity and setting it as the viewer’s selected entity. For example:

Share

Cesium – How to Improve InfoBox ?

In order to run a script in the infobox, you have to enable scrips to run in the iframe. This is disabled by default for security reasons, in case you don’t know the source of the data populating the infobox.
You can enable scrips with this code:

Also, to get the current value of an entity property, you can use .getValue(viewer.clock.currentTime);

Share

Cesium – How to make an InfoBox pop up on demand ?

Share

Cesium – How to show tooltip in cesium ?

Share

cesium – Updating a CZML ‘description’ upon opening the InfoBox ?

updating-CZML-description

Share

cesium – How to enable javascript in InfoBox ?

phpmind-cesiumjs-show-name

The InfoBox does indeed run in an iframe for security and sanitation purposes. You can remove all restrictions by calling the below line of code after creating the view:

Only do this if you are in complete control of the data that will be loaded into the InfoBox, otherwise it is a security issue.

You can style the infoBox just as easy by injecting any css you want into the viewer.infoBox.frame for example:

By default, we inject the contents of Widgets/InfoBox/InfoBoxDescription.css

You can also style outer InfoBox properties by overriding the CSS classes defined in Widgets/InfoBox/InfoBox.css in your own apps css file. I’m not sure if you’ll be able to add draggable support in this way, but you can do a bunch of other stuff.

If you want to replace the infoBox completely, then simply pass “infoBox: false” to the Viewer constructor. It’s then up to you to bring up your own widget when an entity is selected. The InfoBox simply displayed the content of the entity.description property. You could copy/paste the existing InfoBox code as a starting point.

http://www.html5rocks.com/en/tutorials/security/sandboxed-iframes/

Share

Cesiumjs – Draw line with SHIFT and left click ?

cesium_shift_left_key_line

Share

Cesiumjs – Draw line around the globe ?

Draw-line-around-the-globe

Share