@dmp/map-components
    Preparing search index...

    Class LayerControl

    Index

    Properties

    api: Api

    The API instance that should control the state of the LayerControl

    collapsed?: boolean

    As default the LayerControl is expanded. But by adding the collapsed option, it is possible to force the LayerControl as collapsed instead:

    <LayerControl :api="api" :collapsed="true"/>
    
    currentResolution?: number

    If you are using the OpenLayers like descibed above, you can add a reactive property with the current resolution to the component. Then the component will indicate if the dataset is visible in the current zoom level:

    const currentResolution = ref<number>()
    map.on('moveend', () => currentResolution.value = map.getView().getResolution())
    <LayerControl :api="api" :currentResolution="currentResolution"/>
    
    disableDatasetStore?: boolean

    To remove the "Add layers" button from the LayerControl, just add disableDatasetStore like this:

    <LayerControl :api="api" :disableDatasetStore="true"/>
    

    This will remove the buttom as well as the "Show metadata" button and the "Remove layer" button from each dataset in the LayerControl.

    getExpanded: () => boolean

    Get the expanded state

    hiddenDatasets?: string[]

    In some cases, like when using the LayerToggle compoment, you would like to hide some specific datasets in the LayerControl and in the DatasetStore. You can do this using the hiddenDatasets options like this:

    const layerToggleLayers = ['urn:dmp:ds:skaermkort-daempet', 'urn:dmp:ds:ortofoto-foraar-nyeste-tilgaengelige']
    
    <LayerControl :api="api" :hiddenDatasets="layerToggleLayers"/>
    
    hideDatasetStore: () => void

    Hide the dataset store

    Type declaration

      • (): void
      • Hide the DatasetStore

        Returns void

    setExpanded: (shouldExpand?: boolean) => void

    Set the expanded state

    showDatasetStore: () => void

    Show the dataset store

    Type declaration

      • (): void
      • Show the DatasetStore

        Returns void

    showMetadata: (
        dataset: Dataset | DatasetGroup | Organization | DatasetCollection,
    ) => Promise<void>

    Show the metadata detail page for a specific Dataset and more

    Type declaration

    showQGISButton?: boolean

    On the ClientAPI, there is a helper function for downloading datasets as a QGIS project. It is possible to add a "Download QGIS project" button to the settings menu in the LayerControl. Just add showQGISButton as an option like this:

    <LayerControl :api="api" :showQGISButton="true"/>
    

    When the user presses the button, the datasets that are visible in the LayerControl, will be included in the QGOS projekt.

    visual?: Partial<Visual>

    Visual settings for the LayerControl:

    <LayerControl :api="api" :visual="{expanded: false}"/>