• JMap.Event.Layer.on.visibilityChange

    This event is triggered when a tree element visibility changed.

    Parameters

    • listenerId: string

      Your listener id (must be unique for all layer events)

    • fn: ((params) => void)

      Your listener function

    Returns void

    Example

    // Each time a tree element visibility is changed, will display the new visibility
    // in the console
    JMap.Event.Layer.on.visibilityChange(
    "custom-visibility-change",
    params => {
    console.log(`Layer element id="${params.layerId}" visible="${params.visibility}"`)
    }
    )