@magiclane/maps-sdk
    Preparing search index...

    Class ExternalInfo

    ExternalInfo object

    Provides wikipedia information for a landmark.

    Hierarchy

    • GemAutoreleaseObject
      • ExternalInfo
    Index

    Constructors

    • Parameters

      • id: number
      • mapId: number

      Returns ExternalInfo

    Accessors

    • get imagesCount(): number

      Get the count of the images on the Wikipedia page.

      Must be called only after the onWikiDataAvailable callback is triggered

      Returns number

      The count of the images on the Wikipedia page

      An exception if it fails.

    • get mapId(): number

      Returns number

    • get pointerId(): number

      Returns number

    • get wikiImagesCount(): number

      Get the count of the images on the Wikipedia page.

      Must be called only after the onWikiDataAvailable callback is triggered

      Returns number

      The count of the images on the Wikipedia page

      An exception if it fails.

    • get wikiPageDescription(): string

      Get Wikipedia page summary (text).

      Must be called only after the onWikiDataAvailable callback is triggered

      Returns string

      The Wikipedia page summary

      An exception if it fails.

    • get wikiPageLanguage(): string

      Get Wikipedia page language.

      Must be called only after the onWikiDataAvailable callback is triggered

      Returns string

      The Wikipedia page language

      An exception if it fails.

    • get wikiPageTitle(): string

      Get Wikipedia page title.

      Get the Wikipedia page title in the requested language. Must be called only after the onWikiDataAvailable callback is triggered

      Returns string

      The Wikipedia page title

      An exception if it fails.

    • get wikiPageUrl(): string

      Get Wikipedia page URL.

      Must be called only after the onWikiDataAvailable callback is triggered

      Returns string

      The Wikipedia page URL

      An exception if it fails.

    Methods

    • Cancel a specific Wikipedia image info request via requestWikiImageInfo.

      Parameters

      Returns void

      An exception if it fails.

    • Cancel a Wikipedia request for any reason. This method is automatically called if a new request is initiated.

      Returns void

      An exception if it fails.

    • Get Wikipedia image description directly, without notifier.

      Parameters

      • index: number

        Index of the image to get the description of.

      Returns string

      The image description if the index is valid, empty string otherwise

      An exception if it fails.

    • Get Wikipedia image title directly, without notifier.

      Parameters

      • index: number

        Index of the image to get the title of.

      Returns string

      The image title if the index is valid, empty string otherwise

      An exception if it fails.

    • Get Wikipedia image URL directly, without notifier.

      Parameters

      • index: number

        Index of the image to get the URL of.

      Returns string

      The image URL if the index is valid, empty string otherwise

      An exception if it fails.

    • Checks if the landmark has Wikipedia info

      Requests all the wikipedia info at once (page title/url, page summary, and list of pictures - only urls of the pictures) - returns true if request successfully made, false if something went wrong. [ProgressListener] will notifyComplete with [GemError.success] once all the results are received from the Wikipedia API. It will request the info in the language of the device, and will fallback to English if a page in the main language doesn't exist. If neither the main language nor the English version exist, [ProgressListener] will notifyComplete with [GemError.general], and the request will be canceled.

      Parameters

      • landmark: Landmark

        Landmark for which the check will be done.

      Returns boolean

      True if the landmark has Wikipedia info, false otherwise

      An exception if it fails.

    • Registers an object for auto release. When the object is not used anymore, it will be released automatically from C++.

      Parameters

      • pointerId: any

        The pointer ID to register

      Returns void

    • Get info on one Wikipedia image.

      Parameters

      • imageIndex: number

        The image index

      • onComplete: (error: GemError, imageInfo: string | null) => void

        Callback to be called when the request is completed

        • Called with GemError.success and the image info on success.
        • Called with GemError.general error and null on invalid input

      Returns ProgressListener | null

      ProgressListener for the operation progress if it could be started, null otherwise

      An exception if it fails.

    • Requests information about a landmark on wikipedia.

      Parameters

      • landmark: Landmark

        Landmark for which the request will be done.

      • OptionalonWikiDataAvailable: (externalInfo: ExternalInfo | null) => void

        callback to be triggered after the wikipedia request is done. It will be called with the external info object on success and null on error.

      Returns ExternalInfo

      The external info object. The [onWikiDataAvailable] callback should be awaited before accessing data from the object.

      An exception if it fails.