geoview-core - v2.2.0
    Preparing search index...

    Class API

    Class used to handle api calls (events, functions etc...).

    Index

    Constructors

    Properties

    config: typeof ConfigApi = ConfigApi

    ConfigApi static class

    layer: typeof LayerApi = LayerApi

    LayerApi static class

    plugin: typeof Plugin = Plugin

    Load plugins API

    utilities: {
        core: __module;
        date: typeof DateMgt;
        geo: typeof GeoUtilities;
        projection: typeof Projection;
    } = ...

    Utilities object

    Methods

    • Creates a new map in a given div id.

      GV The div MUST NOT have a geoview-map class or a warning will be shown when initMapDivFromFunctionCall is called. If is present, the div will be created with a default config.

      Parameters

      • divId: string

        Id of the div to create map in (becomes the mapId)

      • mapConfig: string

        Config passed in from the function call (string or url of a config path)

      • OptionaldivHeight: number

        Optional height of the div to inject the map in (mandatory if the map reloads)

      • waitOnMapReady: boolean = true

        Optional flag to wait for the map to be ready before resolving the promise

      Returns Promise<MapViewer>

      A promise that resolves with the MapViewer (after the onMapReady is triggered) which will be created from the configuration

    • Creates a new map in a given div id.

      GV The div MUST NOT have a geoview-map class or a warning will be shown when initMapDivFromFunctionCall is called. If is present, the div will be created with a default config.

      Parameters

      • divId: string

        Id of the div to create map in (becomes the mapId)

      • mapConfig: string

        Config passed in from the function call (string or url of a config path)

      • OptionaldivHeight: number

        Optional height of the div to inject the map in (mandatory if the map reloads)

      Returns Promise<MapViewer>

      A promise that resolves with the MapViewer (after the onMapReady is triggered) which will be created from the configuration

    • Deletes a map viewer instance by its ID and unmounts it from the DOM - for React.

      Parameters

      • mapId: string

        The unique identifier of the map to delete

      • deleteContainer: boolean

        True if we want to delete div from the page

      Returns Promise<void>

      A promise that resolves when the map viewer is deleted

    • Gets a map viewer instance by its ID.

      Parameters

      • mapId: string

        The unique identifier of the map to retrieve

      Returns MapViewer

      The map viewer instance if found

      When the map with the specified ID is not found

    • Asynchronously gets a map viewer instance by its ID.

      Parameters

      • mapId: string

        The unique identifier of the map to retrieve

      Returns Promise<MapViewer>

      A promise that resolves with the map viewer instance when/if found

      When the map with the specified ID is not found

    • Returns true if a map id is already registered.

      Parameters

      • mapId: string

        The unique identifier of the map to retrieve

      Returns boolean

      True if map exist

    • Reload a map from a config object stored in store, or provided. It first removes then recreates the map.

      Parameters

      • mapId: string

        The unique identifier of the map to reload

      • OptionalmapConfig: TypeMapFeaturesConfig | TypeMapFeaturesInstance

        Optional map config to use for reload

      Returns Promise<MapViewer>

      A promise that resolves with the MapViewer which will be created once reloaded

    • Reload a map from a config object created using current map state. It first removes then recreates the map.

      Parameters

      • mapId: string

        The unique identifier of the map to reload

      • maintainGeocoreLayerNames: boolean = true

        Indicates if geocore layer names should be kept as is or returned to defaults. Set to false after a language change to update the layer names with the new language

      Returns Promise<MapViewer>

      A promise that resolves with the MapViewer which will be created once reloaded