Your listener id (must be unique)
Your listener function
// Triggered before a map-context is applied
JMap.Event.MapContext.on.beforeApply("my-before-apply-listener", params => {
console.info(`Before apply map context id="${params.context.title}"`, params.context)
const isExtensionDataSet = params.isExtensionDataSetById("my-extension")
if (!isExtensionDataSet) {
console.info("No extension data in map-context")
} else {
console.info("Extension map context data = ", params.getExtensionDataById("my-extension"))
}
})
JMap.Event.MapContext.on.beforeApply
This event is triggered before the map context is applied.
You can access extension's data from this event, see example below.