How to create Custom infoBox Descriptin - Custom GetFeatureInfo

When I click on canvas, I get FeatureInfo and data in infoBox for only one layer, and that is the layer which is last in imageryLayers collection (first to see).

First, can you tell me, where is the function (or whatever) implementation for getting feature info and set infoBox description on GIT for Cesium Development (I wont to see how is that made).

Also, can you tell me explicitly how to reimeplement this, how to write one my own getFeatureInfo and set infoBox description to that result.

My goal is to get feature info for ALL Layers in imageryLayers colection where attribute show is true.

Please help.

Thank you forward.

Hello,

The Viewer calls scene.imageryLayers.pickImageryLayerFeatures, then uses the returned information to populate the infobox. It creates a new Entity, then sets that Entity as the viewer.selectedEntity. The code for that can be found here: https://github.com/AnalyticalGraphicsInc/cesium/blob/master/Source/Widgets/Viewer/Viewer.js#L156-L166

A list of all features found for each layer are returned, but you can see that the Viewer just uses the description from features[0]. You could modify the code here to use the data returned by features from other layers.

Hope this helps!

  • Hannah