Class BlueDotExperimental

Mappedin JS can use the location provided from an indoor positioning system to display a BlueDot on the map, indicating the user's position.

This class is accessed using MapView.BlueDot.

Further details and interactive examples can be found in the BlueDot Guide.

Hierarchy (View Summary, Expand)

Properties

follow: (mode: TFollowMode, cameraOptions?: TFollowCameraOptions) => void

Sets the camera to follow the Blue Dot's position as it updates. User interaction will cancel following automatically.

following: boolean

Accessors

  • get accuracy(): undefined | number
  • Experimental

    The accuracy of the current position in metres.

    Returns undefined | number

  • get coordinate(): undefined | Coordinate
  • Experimental

    The coordinate of the current position.

    Returns undefined | Coordinate

  • get floor(): undefined | Floor
  • Experimental

    The floor the Blue Dot is currently on. If undefined, the Blue Dot will appear on every floor.

    Returns undefined | Floor

Methods

  • Experimental

    Disable the Blue Dot. It will be hidden and no longer update.

    Returns void

  • Experimental

    Enable the Blue Dot. It will be hidden until a position is received either from the browser or by calling BlueDot.update.

    Parameters

    Returns void

  • Experimental

    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: TBlueDotEvents[EVENT_NAME] extends { data: null }
              ? any[any]["data"]
              : TBlueDotEvents[EVENT_NAME],
      ) => void

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

    Returns void

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

    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: TBlueDotEvents[EVENT_NAME] extends { data: null }
              ? any[any]["data"]
              : TBlueDotEvents[EVENT_NAME],
      ) => 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.

    Returns void

    // 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);
  • Experimental

    Manually override some position properties of the Blue Dot. Accepts a full GeolocationPosition object or a partial TBlueDotPositionUpdate object.

    Parameters

    Returns void

    api.BlueDot.update({ accuracy: 10, heading: 90 });
    
    api.BlueDot.update({ accuracy: 'device', heading: 'device' });
    
  • Experimental

    Enable or disable the devices's geolocation listener to automatically position the Blue Dot. If enabled, the device will request permission to access the user's precise location.

    Parameters

    • watch: boolean

      Whether to enable or disable the listener.

    Returns void

MMNEPVFCICPMFPCPTTAAATR