• JMap.Layer.getLayerTreeElementsById

    Returns a map (= a javascript object) where :

    • the key is the tree element id
    • the value is the tree element

    A tree element is a layer group or a layer.

    A layer group contains layer(s) and/or other layer group(s), and has a negative id.

    A layer has a positive id.

    If no project is loaded, returns en empty object.

    Returns {
        [key in JId]: JLayerTreeElement
    }

    Example

    // returns a map of layer elements defined by layer id
    JMap.Layer.getLayerTreeElementsById()