• JMap.Event.MapContext.on.afterApply

    This event is triggered after the map context is applied.

    You can access extension's data from this event, see example below.

    Parameters

    • listenerId: string

      Your listener id (must be unique)

    • fn: ((params) => void)

      Your listener function

    Returns void

    Example

    // Triggered after a map-context is applied
    JMap.Event.MapContext.on.afterApply("my-after-apply-listener", params => {
    console.info(`After 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"))
    }
    })