How to use infobox ?

Can anyone give me some example to use infobox in cesium.
I have to load text content inside an iframe and show it on click of a location in the cesium viewer globe. For that, may I know how InfoBox will help? and please let me know how to show infobox inside iframe?

The default InfoBox that’s included with the Viewer widget is currently meant to be used with Entity instances. For the WMS feature picking (which works similar to what you describe) we just create an entity on the fly. Here’s an example you can use (just paste into Sandcastle). This assumes you actually wanted to do something on click of the globe and not on click of a specific entity or feature.

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

var ellipsoid = viewer.scene.globe.ellipsoid;

viewer.screenSpaceEventHandler.setInputAction(function(e) {

var cartesian =, ellipsoid);

if (cartesian) {

var cartographic = ellipsoid.cartesianToCartographic(cartesian);

var longitudeString = Cesium.Math.toDegrees(cartographic.longitude).toFixed(2);

var latitudeString = Cesium.Math.toDegrees(cartographic.latitude).toFixed(2);

console.log(longitudeString + ', ’ + latitudeString);

viewer.selectedEntity = new Cesium.Entity({

description : longitudeString + ', ’ + latitudeString


} else {

viewer.selectedEntity = undefined;


}, Cesium.ScreenSpaceEventType.LEFT_CLICK);

Dear Matthew,

Could I draw a table in the InfoBox manually? If it's possible, how could I do? Thanks a lot~

Matthew Amato於 2015年3月16日星期一 UTC+8上午9時19分24秒寫道:


I’m not sure exactly what you want to accomplish. Could you give some more detail?



Hi Hannah,

Like the GeoJSON and TopoJSON example in SandCastle, There is a attribute table in the Infobox when I click a JSON feature. Could I complete it for selectedEntity function?

Thanks a lot~

Hannah Pinkos於 2015年11月7日星期六 UTC+8上午12時12分54秒寫道: