• Hook to subscribe to an event on the MapView.

    Type Parameters

    • T extends
          | "click"
          | "hover"
          | "camera-change"
          | "floor-change-start"
          | "floor-change"
          | "dynamic-focus-change"
          | "outdoor-view-loaded"
          | "outdoor-style-loaded"
          | "user-interaction-start"
          | "user-interaction-end"
          | "blue-dot-position-update"
          | "blue-dot-state-change"
          | "blue-dot-error"
          | "blue-dot-follow-change"
          | "navigation-connection-click"
          | "navigation-active-path-change"
          | "pre-render"
          | "post-render"
          | "stacked-maps-state-change"

    Parameters

    • event: T

      The event to listen for.

    • callback: (
          payload: TEvents[T] extends { data: null }
              ? any[any]["data"]
              : TEvents[T],
      ) => void

      The callback to call when the event is triggered.

    Returns void

    useEvent('click', event => {
    const { coordinate } = event;
    const { latitude, longitude } = coordinate;
    console.log(`Map was clicked at ${latitude}, ${longitude}`);
    });
MMNEPVFCICPMFPCPTTAAATR