Imagery Layer Picking in Viewer

How to I catch which imagery layer has been selected in the viewer by the user.

I have a base map layer, then a number of drone imagery layers loaded via ION. These layers may stack or only slightly overlap each other.

I need to catch which layer has been clicked on by the user. I do this with entities using screenSpaceEventHandler.setInputAction, but can’t get imagery layers to work in a similar fashion.

I add the drone images using

var layer = viewer.imageryLayers.addImageryProvider(
new Cesium.IonImageryProvider({ assetId: 123456 })
);

Thanks

Jason

It isn’t currently possible to use the same picking system with entities to pick imagery layers. We have a GitHub issue for this here: https://github.com/CesiumGS/cesium/issues/8692

I think you’d need to get the bounding rectangles of the imagery layers and compute the intersection to find out which one(s) the user has selected.