Class BlueDot

API to enable and respond to user position updates.

Hierarchy

  • BlueDot

Properties

Methods

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