How to emit a cesium click through code and not mouse clicking?

1. A concise explanation of the problem you’re experiencing.

I want to be able to show the green box and info-box that pops up through code and not a mouse click. When you click on an entity in cesium you get a green box and info-box that pops up. I want this exact behavior but not using a click. Is this possible?

2. A minimal code example. If you’ve found a bug, this helps us reproduce and repair it.

3. Context. Why do you need to do this? We might know a better way to accomplish your goal.

4. The Cesium version you’re using, your operating system and browser.

You just need to set the viewer’s selectedEntity (see https://cesiumjs.org/Cesium/Build/Documentation/Viewer.html?classFilter=Viewer#selectedEntity). And you can simulate clicking away by setting that to undefined.

Thank you!

Hi Omar,

It’s helpful as brings me closer to objective, but this does select the entity however is not firing the click event function assigned to it.

Any way to fire the custom click event handler?

Thanks in advance.

Hardik Shah

Can’t you just call the click function directly when you set it as the selectedEntity?