Your listener id (must be unique for all map events)
Your listener function
// Each time the map is destroyed, will display a message in the console
JMap.Event.Map.on.mapDestroy(
"custom-map-destroyed",
() => console.log(`The map has been destroyed`)
)
JMap.Event.Map.on.mapDestroy
This event is triggered when the map is destroyed.