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

    Class ExternalInfoServiceAbstract

    Index

    Constructors

    Methods

    • Internal helper to check Wikipedia info and return both result and ExternalInfo object.

      Parameters

      • landmark: Landmark

        Landmark for which the check will be done.

      Returns [boolean, ExternalInfo]

      [boolean, ExternalInfo] tuple

    • Cancels a Wikipedia info request.

      Parameters

      • operationHandler: EventHandler

        The event handler returned by requestWikiInfo.

      Returns void

    • 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.

      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.

    • Requests Wikipedia info for a landmark. The result will be provided as an ExternalInfo object.

      Parameters

      • landmark: Landmark

        Landmark for which the request will be done.

      • onComplete: (err: GemError, extraInfo: ExternalInfo | null) => void

        Callback to be triggered after the wikipedia request is done.

        • Called with GemError.success and the external info object on success.
        • Called with GemError.invalidInput and null info if the landmark does not have Wikipedia info.
        • Called with GemError.connection and null info if connection is not available or restricted.
        • Called with GemError.notFound and null info if wikipedia info is not found for the landmark.
        • Called with GemError.general and null info on other errors.

      Returns EventHandler | null

      An EventHandler that can be used to cancel the request.

      An exception if it fails.