Masking entity / Hiding the map


I’m trying to hide/mask the rest of the map when a user clicks on an entity.

Essentially I’m loading a black image layer to cover the world, then I would like to cut the shape of an entity or a geojson to show. This is so the selected entity can be in focus.

I have tried Imagelayer rectangle cut out, but this does not take the shape of an entity or geojson coordinates.

Like this example:, but an entity shape or geojson coordinates.

Thank you.

Latest Chrome and Cesium version.