interface LayersOptions {
    autoZIndex?: boolean;
    collapsed?: boolean;
    hideSingleBase?: boolean;
    position?: ControlPosition;
    sortFunction?: ((layerA, layerB, nameA, nameB) => number);
    sortLayers?: boolean;
}

Hierarchy

Properties

autoZIndex?: boolean
collapsed?: boolean
hideSingleBase?: boolean
position?: ControlPosition
sortFunction?: ((layerA, layerB, nameA, nameB) => number)

Type declaration

    • (layerA, layerB, nameA, nameB): number
    • A compare function that will be used for sorting the layers, when sortLayers is true. The function receives both the L.Layer instances and their names, as in sortFunction(layerA, layerB, nameA, nameB). By default, it sorts layers alphabetically by their name.

      Parameters

      • layerA: Layer
      • layerB: Layer
      • nameA: string
      • nameB: string

      Returns number

sortLayers?: boolean

Whether to sort the layers. When false, layers will keep the order in which they were added to the control.

Generated using TypeDoc