Custom infobox with a ajax request

Firstly, I am new at cesium.

I am stuck on a simple problem. I have a geoserver send layers and features with WMS and that is ok. My problem starts because I want display other features, like data relationships about the city that has been clicked.

In other words, I need the id of the city clicked, make a ajax with this ID to my backend server and than get other features, like relationships etc.

I have searched for a method to intercept the response of the WMS request that the cesium does, when I click on a city and parse it, for example. I havent obtained any success on that. I dont know what function does the WMS or how to overwrite it.

I try to after cesium set the selectedEntity on viewer, get the ID, but the entity comes with a ID very large and different from the database.

I try to set infobox to false and get the object with scene.pick(click.positon), but always return undefined.

Any ideas?

Sorry if the question was confusing. I have no clue how to do that.

Thanks for the help

Hi there,

The id you are getting there it the Entity id property, which is created when you add the entity via loading from WMS.

Each feature will be an instance of ImageryLayerFeatureInfo, which has a raw data property. Check to see if you are receiving the database id there. You can then store the database id in an entity property.

Hope that helps, thanks!