Main class for accessing data in the MapsIndoors SDK.

Export

Hierarchy

  • default

Constructors

Methods

  • Add venues to the sync list.

    Parameters

    • venues: string[]

      list of venueIds to add to sync.

    Returns Promise<void>

  • Applies a list of MPUserRoles to the SDK which will get the UserRole specific locations..

    Parameters

    Returns Promise<void>

    Static

    Async

  • Cache all data for the current solution. Including tiles and images if present on the solution.

    Parameters

    • apiKey: String

      The key to the MapsIndoors solution.

    Returns Promise<boolean>

    Promise True if the caching was successful, otherwise false.

  • Checks if there is on device data (embedded/locally stored) available. For this to return true, data has to be available for all solution data types (MPLocation, MPBuilding...).

    Returns true if data is available, otherwise returns false.

    Returns Promise<boolean>

    Static

    Async

  • Clears the internal state of MapsIndoors SDK. Any loaded content is purged from memory.

    Invoke load to start the SDK anew.

    Returns Promise<void>

    Static

    Async

  • disable SDK event logging through MapsIndoors. No logs will be created or send with this disabled.

    By default it is enabled. But disabled in the CMS meaning logs will be created but never uploaded.

    Parameters

    • disable: boolean

    Returns Promise<void>

    Static

    Async

  • Retrieves the API key that was set when calling load.

    Will return empty string if no key has been set.

    Returns Promise<string>

    Static

    Async

  • Returns a list of the current solution's available languages.

    Returns Promise<string[]>

    Static

    Async

  • Returns the default language for the current solution.

    Returns Promise<string>

    Static

    Async

  • Gets the language currently used in the SDK.

    Returns Promise<string>

    Static

    Async

  • Get a list of venueIds that are synced.

    Returns Promise<string[]>

    Promise<string[]> A list of venueIds that are synced.

  • Check if the current API key is valid.

    Returns Promise<boolean>

    Static

    Async

  • Checks whether the map provider in use can cache base-map tiles at all.

    Base-map tiles are the outdoor map rendered underneath MapsIndoors, and they live in the map provider's own storage - separate from the MapsIndoors content cached by cacheData. Only the Mapbox provider can cache them; on the Google Maps provider this returns false and every other base-map caching call rejects with baseMapCachingNotSupported.

    Check this before offering offline base maps in the UI, so an unsupported provider fails fast instead of once per venue.

    Returns Promise<boolean>

    True if base-map tiles can be cached.

    Static

    Async

  • Check if the SDK is initialized and ready for use.

    Returns Promise<boolean>

    Static

    Async

  • Loads content from the MapsIndoors solution matching the given API apiKey.

    Parameters

    • apiKey: String

      The key to the MapsIndoors solution.

    • Optional venues: String[] = null

      An optional list of venueIds as strings.

    Returns Promise<void>

    If the load fails for any reason, it will reject with a MPError.

    Static

    Async

  • Remove venues from the sync list.

    Parameters

    • venues: string[]

      List of venueIds to remove from sync.

    Returns Promise<void>

  • Enables or disables base-map tile caching for the solution matching the given apiKey.

    The flag only marks the solution, it downloads nothing - call synchronizeBaseMapTiles for that. Turning it off does not remove already-cached tiles either; those are reclaimed when the solution's cache is removed.

    The flag is persisted, so it survives an app restart and only has to be set once.

    It is a property of the solution, not of the map provider, so it is accepted and stored even where isBaseMapCachingSupported is false - on Google Maps this resolves successfully and sets a flag nothing can act on, and only synchronizeBaseMapTiles reports baseMapCachingNotSupported. Check isBaseMapCachingSupported first if you need to know before then. Rejecting here instead would make the same call behave differently per map provider, which is worse for code meant to run against either.

    Parameters

    • enabled: boolean

      True to cache base-map tiles for this solution.

    • apiKey: string

      The key to the MapsIndoors solution.

    Returns Promise<void>

    If the solution is not managed, or the call fails for any other reason, it will reject with a MPError.

    Static

    Async

  • Sets the SDK's internal language.

    The tag should be one the solution advertises - see getAvailableLanguages - and is matched loosely: casing is ignored, and legacy region-only Chinese tags resolve to their script, so zh-CN selects zh-Hans and zh-TW selects zh-Hant. Use hasLanguage to check a tag before calling, or resolveLanguage to turn a device locale into the exact tag the solution publishes.

    Until this is called, the SDK language is:

    • the solution's default language - see getDefaultLanguage.
    • the current device language, if the MapsIndoors data isn't available (ie: first app run without network access).

    The returned boolean does not mean the same thing on both platforms, and an app should not branch on it without reading this:

    • On Android it is false when the tag does not resolve against the solution's available languages, and also when the SDK has no solution yet or is mid- synchronizeContent. In that second case the change is queued and applied once the SDK is ready, so false is not "it will never take effect".
    • On iOS it reports only that the tag was accepted; there is no check against the solution's available languages, so in the default configuration it is true for any non-empty tag. An unsupported language is reconciled later, on the next solution fetch, which reverts the SDK to the solution's default.

    A false here is therefore a reliable "this did not take effect" signal on Android only. To confirm the language actually changed on either platform, read it back with getLanguage.

    An empty or whitespace-only tag resolves false without reaching the native SDK, matching Android's own precondition. iOS would otherwise accept it and store an empty language.

    Parameters

    • language: string

      A BCP-47 language tag, for example en, zh-Hans or zh-CN.

    Returns Promise<boolean>

    Static

    Async

  • Downloads and caches base-map tiles so the map can render without a network connection.

    Covers every solution that base-map tile caching has been enabled for with setBaseMapTilesEnabled, unless apiKeys narrows it to a subset. This is a long-running network download that can take minutes - pass onProgress to follow it.

    This runs independently of synchronizeContent and cacheData, which cache the MapsIndoors content itself. Both are needed for a fully offline map.

    On iOS, a MapView has to have been mounted at least once first: the iOS SDK registers its base-map cache when it builds the map provider, and until then this rejects with baseMapCachingNotSupported even on Mapbox. Android has no such ordering requirement.

    Run one call at a time. Progress arrives on a single channel carrying only the fraction, with nothing identifying the call, so two overlapping calls interleave their progress - including into a caller that passed no onProgress of its own. The default already covers every enabled solution in one call, so there is rarely a reason to fan out.

    Parameters

    • Optional onProgress: OnBaseMapCacheProgressListener

      Optional listener called with the fraction completed, from 0.0 to 1.0. Not every map provider reports progress.

    • Optional apiKeys: string[]

      An optional list of solution API keys to narrow the operation to. Defaults to every solution with base-map tile caching enabled. An empty array narrows it to nothing and caches nothing, which is deliberately not the same as omitting the argument - a filter that matched no solutions should not turn into a download of all of them.

    Returns Promise<void>

    Rejects with a MPError if the map provider cannot cache base-map tiles (baseMapCachingNotSupported) or a download fails.

    Static

    Async

  • Main data synchronization method.

    If not manually invoked, [MapControl.create(config, listener)] will invoke it.

    Returns Promise<void>

    Static

    Async

Generated using TypeDoc