Your listener id (must be unique for all map events)
Your listener function
// When the selection changed, will display old and new selections in the console
JMap.Event.Map.on.selectionChanged(
"custom-selection-changed",
params => {
console.log("Old selection:", params.oldSelection)
console.log("New selection:", params.newSelection)
}
)
JMap.Event.Map.on.selectionChanged
This event is triggered when the map selection has changed.