Cesium WMS default getFeatureInfo

Hi all,

I am trying to do a getFeatureInfo request on a WMS layer loaded in Cesium.

I saw that there is a parameter in the WMSImageryProvider that enables the getFeatureInfo operation.

I was wondering how to get the response from the getFeatureInfo that Cesium does as default and store it for later use/display.

Thanks for your time,

I'm stuck at the same point!

I read the documentation but I can't figure out how I can use the PickFeatures function in order to get the Promise back and display the results.

Any suggestion?

Hi, have you seen the example in the reference documentation for ImageryLayerCollection.pickImageryLayerFeatures?



Hi Kevin,

thank you for your reply... I had a look at the link... and this was what I really needed, but our servers don't accept the mime type application/json and text/xml...

We have to request text/plain. I tried to forced this format as follow:

var wmsprovider = new Cesium.WebMapServiceImageryProvider({
      url: serviceURL,
      layers: layersName,
      enablePickFeatures : true,
      getFeatureInfoAsXml : false,
      getFeatureInfoAsGeoJson : false,
      getFeatureInfoParameters : {
        info_format : 'text/plain'
      parameters : {
        transparent: 'true',
        format: 'image/png',
        crs: 'EPSG:4326'

but the Promise isn't raised with this method. Is there another way?

I tried to find a workaround and I looked into Cesium code, more in specific at:

and I customized my script, based on this, in order to calculate the right parameters to build my own URL.

If you have any other suggestion, is more than welcome!


What sort of WMS server are you talking to? What does it return when you request text/plain? Cesium currently requires that the GetFeatureInfo response be either JSON or XML (with any info_format). That requirement could potentially be relaxed.



the services are exposed by MapServer and this an example of request:


In the input handler of the viewer I setup the pickImageryLayerFeatures as described in the documentation.


You may be interested that we just merged a change to WebMapServiceImageryProvider to make it automatically support “text/html” GetFeatureInfo out of the box. You can also make it request any MIME type and specify an optional processing function to turn the response into ImageryLayerFeatureInfo. This will ship in Cesium 1.10 the first week of June.



Hi Kevin,

Great! I know that the text/plain is not the best output... but we have no control on the server side...

Thank you for the support,