Changing selectionIndicator and infoBox on the fly

In my project, 95% of the time, having the selectionIndicator and infoBox enabled is the desired behavior, however the other 5% of the time it would make more sense to disable it for some user interactions. I am able to turn them on/off globally when the viewer is first loaded, but that leaves them in that state. This is my first real dive into JS, so maybe I’m just missing something obvious.

When I set the following variables in my function, I don’t get any errors, however I don’t get any results either. Is this a property that can only be set when the viewer is first loaded?
viewer.selectionIndicator = false;
viewer.infoBox = false;

Hello @Corey,

It sounds like you’ll have to override the viewer’s default click handler in order to achieve the functionality you’re looking for. I put together a code example here that shows how to use your own custom function for click handling: Cesium Sandcastle

Best regards,


Thanks, Hannah! That worked perfectly.