Helper class for some operations related to permalink function.

Constructors

Methods

  • Applies an existing permalink to the given map.

    Parameters

    • map: Map

      The OpenLayers map.

    • separator: string = ';'

      The separator of the layers list and center coordinates in the link. Default is to ';'.

    • identifier: ((layer) => string) = ...

      Function to generate the identifier of the layer in the link. Default is the name (given by the associated property) of the layer.

        • (layer): string
        • Parameters

          • layer: BaseLayer

          Returns string

    • filter: ((layer) => boolean) = ...

      Function to filter layers that should be handled by the link. Default is to consider all current map layers of type ol/layer/Tile.

        • (layer): boolean
        • Parameters

          • layer: BaseLayer

          Returns boolean

    Returns null | string

    The customLayerAttributes, if defined. Otherwise null.

  • Creates a permalink based on the given map state. It will contain the current view state of the map (center and zoom) as well as the current (filtered) list of layers.

    Parameters

    • map: Map

      The OpenLayers map

    • separator: string = ';'

      The separator for the layers list and center coordinates in the link. Default is to ';'.

    • identifier: ((l) => any) = ...

      Function to generate the identifier of the layer in the link. Default is the name (given by the associated property) of the layer.

        • (l): any
        • Parameters

          • l: BaseLayer

          Returns any

    • filter: ((l) => boolean) = ...

      Function to filter layers that should be added to the link. Default is to add all visible layers of type ol/layer/Tile.

        • (l): boolean
        • Parameters

          • l: BaseLayer

          Returns boolean

    • customAttributes: string[] = []

      Custom layer attributes which will be saved in the permalink for each layer.

    Returns string

    The permalink.

  • Search through the given Ol-Collection for the given id and set all parenting groups visible.

    Parameters

    • map: Map

      The openlayers map

    • coll: Collection<BaseLayer>

      The Openlayers Collection

    • id: string

      Ther layer ol uid to search for

    Returns void