Class AegirLegacyMap

The aegir LegacyMap model contains all of the functions for supporting legacy venue map data files in your web application. Import the @aegirmaps/aegir-js-sdk module in your ES6 web application and legacy venue map data files will be handled seamlessly. There is no additional work required.

Since

2.0.0

Example

Using JavaScript asyn/await:

const venue = 'my-legacy-map`;
const venueBaseURL = 'https://someplace'
const legacyMap = new AegirLegacyMap(venue, venueBaseURL);
await legacyMap.loadData();
await legacyMap.loadMapView('divId', accessToken);

At this point the map is in the UI and normal interaction can take place. Like listening for unit selection:

legacyMap.addClickListener({
onSelection: (e) => {
const message = `Unit: ${e.name} \nId: ${e.id} \nFloor: ${e.floorId} \n Location:[${e.centerLocation?.lng},${e.centerLocation?.lat}]`;
alert(message);
},
});

Hierarchy

  • AegirLegacyMap

Accessors

  • get map(): Map
  • Returns Map

  • get siteMapUrl(): string
  • Returns string

  • get venueId(): string
  • Returns string

Constructors

  • Constructor function for the Legacy map

    Parameters

    • venueId: string

      Venue id

    • venueBaseURL: string

      Base venue URL

    • options: LegacyMapOptions = {}

      Optional configuration options for the legacy map

    • logger: Logger = globalLogger

    Returns AegirLegacyMap

Methods

  • Parameters

    • listener: {
          onSelection: ((u) => void);
      }
      • onSelection: ((u) => void)

    Returns void

  • Parameters

    • Rest ...floors: string[]

    Returns void

  • Frees all map resources

    Returns void

  • Returns and array of the currently selected floors

    Returns LegacyFloor[]

    An array floors

  • Get the Floor using the id

    Parameters

    • id: string

      The floor id

    Returns LegacyFloor

    The Legacy floor instance or undefined if no floor is found

  • Asynchronous initialization of the venue map loads the venue data to create the internal model that represents the venue map

    Returns Promise<AegirLegacyMap>

    The instance of this class after initialization

    Throws

    An Exception if the data model can't be loaded

  • Asynchronous loads the MapLibre instance and renders the venue map, to be called before any UI interaction with the map

    Parameters

    • mapContainer: string | HTMLElement

      The html element where the map will be inserted

    • accessToken: string

      Access token for TileMap services

    • controlsPosition: ControlPosition = 'top-left'

      Position of the map controls

    • useDefaultMapProvider: boolean = true

      Render within the map provider street style

    Returns Promise<void>

  • Parameters

    • event: keyof MapEventType
    • listener: any

    Returns void

  • Parameters

    • listener: any

    Returns (() => void)

      • (): void
      • Returns void

  • Parameters

    • listener: {
          onSelection: ((u) => void);
      }
      • onSelection: ((u) => void)

    Returns void

  • Returns void

Properties

availableMapProviders: MapProviderType[] = []
siteMapUrlResolver: AegirMapUrlResolver = ...

Resolver instance that gets the URL path for the site map xml file

Param

The venue name or id

Param

The base URL

Returns

The URL path for the XML site map file

Generated using TypeDoc