Class BlueDot

API to enable and respond to user position updates.

Hierarchy

  • BlueDot

Properties

off: (<EVENT_NAME>(eventName, fn) => void)

Type declaration

    • <EVENT_NAME>(eventName, fn): void
    • Unsubscribe a function that was previously subscribed with on.

      mapView.BlueDot.on(E_BLUEDOT_EVENT.POSITION_UPDATE, blueDotChangeHandler);

      ...

      // Something changed and I no longer want this event to fire
      mapView.BlueDot.off(E_BLUEDOT_EVENT.POSITION_UPDATE, blueDotChangeHandler);

      Type Parameters

      Parameters

      • eventName: EVENT_NAME

        An E_BLUEDOT_EVENT that is fired when the blue dot changes.

      • fn: ((payload) => void)

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

      Returns void

on: (<EVENT_NAME>(eventName, fn) => void)

Type declaration

    • <EVENT_NAME>(eventName, fn): void
    • Subscribe a function to be called when an E_BLUEDOT_EVENT is fired.

      const blueDotChangeHandler = ({ map, nearestNode, position, bearing }) => {
      // Do something with the new values
      };
      mapView.BlueDot.on(E_BLUEDOT_EVENT.POSITION_UPDATE, blueDotChangeHandler);

      Type Parameters

      Parameters

      • eventName: EVENT_NAME

        An E_BLUEDOT_EVENT that is fired when the blue dot changes.

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

      Returns void

Methods

  • Disables Blue Dot that was enabled with enable and stops emitting events.

    // Enable blue dot
    mapView.BlueDot.enable();

    // Disable blue dot
    mapView.BlueDot.disable();

    Returns void

  • Returns void

  • Parameters

    • mapId: string
    • Optional options: {
          restoreWhenNewFloorLevelIsReceived: boolean;
      }
      • restoreWhenNewFloorLevelIsReceived: boolean

    Returns void

  • Updates the bearing (direction) of the blue dot on the map.

    Parameters

    • Optional v: number

      The new bearing value in degrees. If undefined, the bearing will be reset. 0 degrees points north, 90 degrees points east, and so on.

    Returns void