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

    Class Api

    The Api is the core component of @dmp/map-components:

    import Api from "@dmp/map-components"
    
    const api = new Api()
    

    Hierarchy

    • Observable
      • Api
    Index

    Constructors

    • The constructor creates a api object to use in components like a layer control or to add to a map.

      Parameters

      • options: ApiOptions

        contains the initial settings for the API.

      Returns Api

    Accessors

    • get activeDatasets(): Collection

      Get a collection of active Dataset. The order defines the rendering order in the map and ind the layerswitch

      Returns Collection

    • set activeDatasets(datasets: Collection | (Dataset | DatasetGroup)[]): void

      Change the collection of active Dataset. The order defines the rendering order in the map and ind the layerswitch

      Parameters

      Returns void

    • get locale(): string

      Get the current locale.

      Returns string

    Methods

    • Add a local Dataset and use it like any other dataset. The dataset will not be stored or persisted in any form

      Parameters

      • config: PartialDataset

        a JSON representation of the Dataset with recursively partial properties

      Returns Promise<Dataset>

    • Exclude a Dataset from the session. The dataset will only be removed locally until page reload. The next time a method on this api is called, the dataset will be excluded. If the dataset is part of the activeDatasts collection, then it will be removed from that list.

      Parameters

      • id: string

        the ID of the Dataset that should be excluded

      Returns void

    • Deserialize a JSON to change the list active Dataset

      Parameters

      • datasetState: DatasetState[]

        a JSON representation of the active Datasets

      Returns Promise<void>

    • Get the backend version.

      Returns Promise<any>

    • Find Dataset Collections by text. Match text in id, title, description and tags.

      Parameters

      • searchString: string

        String containing the

      • OptionaldatasetCollections: DatasetCollection[]

        Default is all datasetCollections

      • Optionaloptions: IFuseOptions<DatasetCollection>

        Options for the search

      Returns Promise<DatasetCollection[]>

      a list of datasetCollections matching the search string and ordered by best match

      Use the search method instead

    • Find Dataset Owners by text. Match text in id, title, description and tags.

      Parameters

      • searchString: string

        String containing the

      • Optionalowners: Organization[]

        Default is all Owners

      • Optionaloptions: IFuseOptions<Organization>

        Options for the search

      Returns Promise<Organization[]>

      a list of Dataset Owners matching the search string and ordered by best match

      Use the search method instead

    • Find datasets by text. Match text in id, title, description, owners, category and tags.

      Parameters

      • searchString: string

        String containing the

      • Optionaldatasets: (Dataset | DatasetGroup)[]

        Default is the current active and visible datasets

      • Optionaloptions: IFuseOptions<Dataset | DatasetGroup>

        Options for the search

      Returns Promise<(Dataset | DatasetGroup)[]>

      a list of dataset matching the search string and ordered by best match

      Use the search method instead

    • Parameters

      • event: string
      • ...args: unknown[]

      Returns void

    • Request a Dataset with a specific id

      Parameters

      • id: string

        A Dataset ID

      • OptionalincludeAttributes: boolean

        Include all the details of a Dataset like wfsSource attributes and more

      • Optionalreload: boolean

        Omit the client cache

      Returns Promise<Dataset | DatasetGroup>

      a the Dataset

    • Request a DatasetGroup with a specific id

      Parameters

      • id: string
      • OptionalincludeAttributes: boolean

        Include all the details of a Dataset like wfsSource attributes and more

      • Optionalreload: boolean

        Omit the client cache

      Returns Promise<DatasetGroup>

      a the DatasetGroup

    • Get an OpenLayes colllection of the active Datasets to add for the map.

      Returns LayerGroup

      a OpenLayers LayerGroup

    • Get all Tags related to any previously fetched Dataset

      Returns Promise<Tag[]>

    • Is the api currently loading a DatasetState.

      Returns boolean

    • Load an initial list of active Dataset

      Parameters

      • OptionaldatasetState: DatasetState[]

        a JSON representation of the active Datasets

      Returns Promise<void>

    • Remove a listen from an event

      Parameters

      • listener: EventListener_2

        returned by the on method

      Returns void

    • Listen to an event

      Parameters

      • event:
            | "change:activedatasets"
            | "change:activedatasets.add"
            | "change:activedatasets.remove"
            | "change:favorite"
            | "change:visible"
            | "change:opacity"
            | "change:locale"
            | "loading"
            | "datasetAdded"

        Name of the event

      • callback: EventListenerCallback

        When the event is triggered

        • For 'change:activedatasets' the callback function is called with the event name and the new list of active Dataset
        • For 'change:activedatasets.add' the callback function is called with the event name and the added Dataset
        • For 'change:activedatasets.remove' the callback function is called with the event name and the removed Dataset
        • For 'change:favorite' the callback function is called with the event name and the Dataset that have changed the favorite state
        • For 'change:visible' the callback function is called with the event name and the Dataset that have changed the visible state
        • For 'change:opacity' the callback function is called with the event name and the Dataset that have changed the opacity state
        • For 'change:locale' the callback function is called with the event name and the locale
        • For 'loading' the callback function is called with a boolean that indicates if a DatasetState is loading
        • For 'datasetAdded' the callback function is called with a Dataset that that is added to the store

      Returns EventListener_2

      A listener that can be used for removing the listener

    • Query a list of Dataset with a coordinate

      Parameters

      • coordinate: Coordinate

        The coordinate to query with

      • Optionaldatasets: (Dataset | DatasetGroup)[]

        Default is the current active and visible datasets

      • Optionaloptions: QueryOptions

        Options for the query

      Returns Promise<QueryResult>[]

      a list of queried dataset with the related hits

    • Query a list of Dataset with an extent

      Parameters

      • extent: Extent

        The bounding box to query with

      • Optionaldatasets: (Dataset | DatasetGroup)[]

        Default is the current active and visible datasets

      • Optionaloptions: QueryOptions

        Options for the query

      Returns Promise<QueryResult>[]

      a list of queried dataset with the related hits

    • Query a list of Dataset with a geometry

      Parameters

      • geometry: Geometry

        An OpenLayers Geometry to query with

      • Optionaldatasets: (Dataset | DatasetGroup)[]

        Default is the current active and visible datasets

      • Optionaloptions: number | QueryOptions

        Use QueryOptions.limit and not the legacy number as limit

      Returns Promise<QueryResult>[]

      a list of queried dataset with the related hits

    • Remove a Dataset from the exclution list. The next time a method on this api is called, the dataset will NOT be excluded.

      Parameters

      • id: string

        the ID of the Dataset that should be removed from the exclution list

      Returns void

    • Reset to the initial list of active Dataset

      Returns Promise<void>

    • Returns void

    • Find Datasets, Dataset Collections or Organizations by text.

      Parameters

      • searchContext: SearchContext
      • OptionalsearchMethod: "client" | "ai"

        'ai' (default) or 'client' as search method where 'ai' is using a AI based search engine and 'client' is a client side text search on multiple fields

      Returns Promise<(Dataset | DatasetGroup | Organization)[]>

      a list of Datasets, Dataset Collections or Organizations matching the search string and ordered by best match

    • Serialize the current list of active Dataset

      Returns DatasetState[]

      a JSON representation of the active Datasets

    • Change the locale.

      Parameters

      Returns Promise<void>

    • Subscribe to auto updating availability status on all active Datasets

      Returns Promise<void>

    • Subscribe to auto updating availability status on all currently fetched Datasets

      Returns Promise<void>