Hierarchy

Constructors

  • Parameters

    • options: TGetVenueOptionsInternal<TAllGetVenueOptions>

    Returns Mappedin

    Deprecated

    Use hydrateVenue instead

Properties

analytics: IAnalytics
categories: MappedinCategory[] = []
currentLanguage: {
    code: string;
    name: string;
}

Type declaration

  • code: string
  • name: string
events: MappedinEvent[] = []
imageBinaries?: Map<string, Uint8Array>
images: any
locationStates: MappedinLocationState[] = []
locations: MappedinLocation[] = []
mapGroups: MappedinMapGroup[] = []
maps: MappedinMap[] = []
nodes: MappedinNode[] = []
options: any
perspective: any
polygons: MappedinPolygon[] = []
rankings?: MappedinRankings
scenes: any
themes: MappedinTheme[] = []
things: any
updatedAt?: string
venue: MappedinVenue = ...
vortexes: MappedinVortex[] = []

Methods

  • Change the language of the venue. This will trigger a re-fetch of the venue data and emit a {GET_VENUE_EVENT.LANGUAGE_CHANGED} event.

    Parameters

    • languageCode: string

      The language code to change to

    • cache: boolean = true

      Whether or not to cache the current language so it doesn't need to be re-fetched

    Returns Promise<void>

  • Parameters

    • updateInPlace: boolean = false

    Returns Promise<void>

  • Type Parameters

    • T extends keyof TAccessors

    • I extends string

    Parameters

    • name: T
    • id: I

    Returns TAccessors[T]

  • Experimental

    Hydrate the Mappedin instance using a response from either Mappedin.toString, getVenueBundle or by downloading the bundle manually

    Parameters

    • mappedinSerializableData: string | Record<string, unknown>

      Mappedin data that was serialized or exported as JSON

    • shouldPopulateBundledImagesAsBlobs: boolean = false

      Takes the scenes and images from a bundle and maps them as blobs to where they exist as URLs in the bundle. False by default

    • updateInPlace: boolean = false

    Returns Promise<undefined>

  • Unsubscribe a function previously subscribed with on

    Type Parameters

    Parameters

    • eventName: EVENT_NAME

      An event name to which the provided function was previously subscribed.

    • fn: ((payload) => void)

      A function that was previously passed to on. The function must have the same reference as the function that was subscribed.

        • (payload): void
        • Parameters

          • payload: GET_VENUE_PAYLOAD[EVENT_NAME]

          Returns void

    Returns void

    Example

    // Unsubscribe from the 'click' event
    const handler = (event) => {
    console.log('Map was clicked', event);
    };
    map.off('click', handler);
  • Subscribe a function to an event.

    Type Parameters

    Parameters

    • eventName: EVENT_NAME

      An event name which, when fired, will call the provided function.

    • fn: ((payload) => void)

      A callback that gets called when the corresponding event is fired. The callback will get passed an argument with a type that's one of event payloads.

        • (payload): void
        • Parameters

          • payload: GET_VENUE_PAYLOAD[EVENT_NAME] extends {
                    data: null;
                }
                ? any[any]["data"]
                : GET_VENUE_PAYLOAD[EVENT_NAME]

          Returns void

    Returns void

    Example

    // Subscribe to the 'click' event
    const handler = (event) => {
    const { coordinate } = event;
    const { latitude, longitude } = coordinate;
    console.log(`Map was clicked at ${latitude}, ${longitude}`);
    };
    map.on('click', handler);
  • Export venue data to JSON (for storage, encryption, etc)

    Parameters

    • includeOptions: boolean = false

    Returns any

  • Export venue data to String

    Parameters

    • includeOptions: boolean = false

    Returns string