Class MapData

Represents the data for a map, providing access to map elements like spaces, floors, and points of interest.

Hierarchy

  • MapData

Implements

  • IMapData

Accessors

  • get mapName(): string
  • Gets the name of the map.

    Returns string

    The name of the map.

  • get organizationId(): string
  • Gets the organization ID of the map.

    Returns string

    The organization ID of the map.

  • get outdoorViewToken(): undefined | string
  • The token is used to fetch outdoor tiles, which will then be rendered.

    Returns undefined | string

    The outdoor view token.

Methods

  • Retrieves a specific map feature by its type and ID.

    Parameters

    • type: "space"

      The type of the element to retrieve (e.g., 'space', 'object').

    • id: string

      The ID of the element.

    Returns undefined | Space

    The feature with the given type and ID, or undefined if it does not exist.

    Example

    const space = mapData.getById('space', 'space-id');
    
  • Parameters

    • type: "door"
    • id: string

    Returns undefined | Door

  • Parameters

    • type: "floor"
    • id: string

    Returns undefined | Floor

  • Parameters

    • type: "connection"
    • id: string

    Returns undefined | Connection

  • Parameters

    • type: "object"
    • id: string

    Returns undefined | MapObject

  • Parameters

    • type: "point-of-interest"
    • id: string

    Returns undefined | PointOfInterest

  • Parameters

    • type: "annotation"
    • id: string

    Returns undefined | Annotation

  • Parameters

    • type: string
    • id: string

    Returns undefined | object

  • Retrieves all map elements of a specific type.

    Parameters

    • type: "space"

      The type of elements to retrieve (e.g., 'space', 'object').

    Returns Space[]

    An array of elements of the given type.

    Example

    const spaces = mapData.getByType('space');
    
  • Parameters

    • type: "door"

    Returns Door[]

  • Parameters

    • type: "floor"

    Returns Floor[]

  • Parameters

    • type: "connection"

    Returns Connection[]

  • Parameters

    • type: "object"

    Returns MapObject[]

  • Parameters

    • type: "point-of-interest"

    Returns PointOfInterest[]

  • Parameters

    • type: "annotation"

    Returns Annotation[]

  • Parameters

    • type: string

    Returns object[]