Home > @magiclane/maps-sdk > ExternalInfo

ExternalInfo class

ExternalInfo object

Provides wikipedia information for a landmark.

Places

Signature:

export declare class ExternalInfo extends GemAutoreleaseObject 

Extends: GemAutoreleaseObject

Constructors

Constructor

Modifiers

Description

(constructor)(id, mapId)

Constructs a new instance of the ExternalInfo class

Properties

Property

Modifiers

Type

Description

imagesCount

readonly

number

Get the count of the images on the Wikipedia page.

Must be called only after the onWikiDataAvailable callback is triggered

mapId

readonly

number

pointerId

readonly

number | bigint

wikiImagesCount

readonly

number

Get the count of the images on the Wikipedia page.

Must be called only after the onWikiDataAvailable callback is triggered

wikiPageDescription

readonly

string

Get Wikipedia page summary (text).

Must be called only after the onWikiDataAvailable callback is triggered

wikiPageLanguage

readonly

string

Get Wikipedia page language.

Must be called only after the onWikiDataAvailable callback is triggered

wikiPageTitle

readonly

string

Get Wikipedia page title.

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

wikiPageUrl

readonly

string

Get Wikipedia page URL.

Must be called only after the onWikiDataAvailable callback is triggered

Methods

Method

Modifiers

Description

cancelWikiImageInfoRequest(listener)

Cancel a specific Wikipedia image info request via requestWikiImageInfo.

cancelWikiInfo()

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

create()

static

getExternalInfo(landmark, onWikiDataAvailable)

static

Requests information about a landmark on wikipedia.

getWikiImageDescription(index)

Get Wikipedia image description directly, without notifier.

getWikiImageTitle(index)

Get Wikipedia image title directly, without notifier.

getWikiImageUrl(index)

Get Wikipedia image URL directly, without notifier.

hasWikiInfo(landmark)

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.

requestWikiImageInfo(imageIndex, onComplete)

Get info on one Wikipedia image.