GeoJSON layer highlight, mousenter, mousover

Hi,

I am looking to add a callback to a layer, on my map each colored area is made up of a GeoJSON layer. I would like to display information on each area=layer when the mouse passes over it, and the icing on the cake is that it works in 3D (image 00)…

For this I am trying to develop a first test (image 01). I want to reproduce the 2D behavior, selection of each area when the mouse passes over it and display of text information (south sahara desert for example), in 3D.

After research I found some things (https://sandcastle.cesium.com/, Mouse Hover Event, Color change hoover GeoJSON…) but it does not correspond to my GeoJSON layer case…
Is there an example that matches what I want to do?
Docs, pointers… are welcome.

Try Cesium.ScreenSpaceEventHandler

const handler = new Cesium.ScreenSpaceEventHandler(viewer.scene)
handler.setInputAction( e => {
// ...
},Cesium.ScreenSpaceEventType.MOUSE_MOVE)

You can set a unique name for the dataSource, and use viewer.dataSources.getByName(...) and viewer.dataSources.contains(...) to compare with what you get in the callback.

Thank you for this feedback

With a canvas parameter the callback works.
In my test I do not have a DataSource. I create my layer with a Vector.
This is confirmed with view.dataSources which is “empty”.
Is there a way to find and work with a layer created without a DataSource

I’ve attached my test program, I’m still digging…

test3_OLCesium.zip (1.3 KB)