• JMap.Layer.setSelectabilityById

    Set the selectability property of the layer.

    If it's true, the layer's features can be selected on the map.

    Parameters

    • layerId: JId

      The JMap layer id

    • selectability: boolean

      The new selectability property value for the layer

    • Optional ignoreVisibility: boolean

      If false or unspecified will make sure that the layer is visible

    Returns void

    Throws

    Error if no layer found for the id or if it is not a vector layer

    Example

    // make layer id=5 selectable
    JMap.Layer.setSelectabilityById(5, true)

    // make layer id=3 unselectable (will clear the pre-existing selection if present)
    JMap.Layer.setSelectabilityById(3, false)