The Api is the core component of the Lagvaelger:

import Api from "@dmp/lagvaelger-client-api"

const api = new Api()

Hierarchy

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

Properties

_activeDatasets: Collection = ...
_endpoint: string
_excludedDatasets: string[] = []
_initialDatasetState: DatasetState[] = ...
_loadingQueue: number = 0
_olGroup: LayerGroup = ...
_onlyQueryable: boolean
_onlyRenderable: boolean
_options: ApiOptions
_store: JsonApiStore
_testdata: TestdataOptions = ...
hasSubscribed: boolean = false
isPolling: boolean = false

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: Dataset[] | Collection): void
  • Change the collection of active Dataset. The order defines the rendering order in the map and ind the layerswitch

    Parameters

    Returns void

Methods

  • Returns void

  • Returns BaseLayer[]

  • Returns void

  • Parameters

    • params: Record<string, string>
    • Optional filter: string

    Returns Record<string, string>

  • Deserialize a JSON to change the list active Dataset

    Parameters

    • datasetState: DatasetState[]

      a JSON representation of the active Datasets

    Returns Promise<void>

  • Returns Promise<any>

  • Parameters

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

    Returns void

  • Request a Dataset with a specific id

    Returns

    a the Dataset

    Parameters

    • id: string

      of a Dataset

    • includeAttributes: boolean = false

    Returns Promise<Dataset>

  • Request a list of all Dataset using a filter

    Returns

    a collection of Datasets

    Parameters

    • Optional filter: string

      to get a list of available Dataset

    • reload: boolean = false

    Returns Promise<Dataset[]>

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

    Returns

    a OpenLayers LayerGroup

    Returns 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

    • Optional datasetState: DatasetState[]

      a JSON representation of the active Datasets

    Returns Promise<void>

  • Parameters

    Returns void

  • Remove a listen from an event

    Parameters

    Returns void

  • Listen to an event

    Returns

    A listener that can be used for removing the listener

    Parameters

    • event: "change:visible" | "change:favorite" | "change:activedatasets" | "loading"

      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: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 'loading' the callback function is called with a boolean that indicates if a DatasetState is loading

    Returns EventListener

  • Poll availability status and update all Datasets that has been previously fetched

    Returns Promise<void>

  • Query a list of Dataset with a Filter

    Returns

    a list of queried dataset with the related hits

    Parameters

    • filter: Filter
    • Optional datasets: Dataset[]

    Returns Promise<QueryResult>[]

  • Query a list of Dataset with a coordinate

    Returns

    a list of queried dataset with the related hits

    Parameters

    • coordinate: Coordinate
    • Optional datasets: Dataset[]

      optional. Default is active, visible datasets

    • Optional options: QueryOptions

    Returns Promise<QueryResult>[]

  • Query a list of Dataset with an extent

    Returns

    a list of queried dataset with the related hits

    Parameters

    • extent: Extent
    • Optional datasets: Dataset[]

      optional. Default is active, visible datasets

    • Optional options: QueryOptions

    Returns Promise<QueryResult>[]

  • Returns void

  • Reset to the initial list of active Dataset

    Returns Promise<void>

  • Returns void

  • Serialize the current list of active Dataset

    Returns

    a JSON representation of the active Datasets

    Returns DatasetState[]

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

    Returns Promise<void>

Generated using TypeDoc