• Hook to get the MapData and handle loading and error states.

    If used outside of a MapDataProvider or MapView component, options are required to fetch the MapData. If used within a MapDataProvider or MapView component, options are optional and will use the MapData from the context if available.

    Parameters

    Returns { error?: Error; isLoading: boolean; mapData?: MapData }

    const { mapData, isLoading, error } = useMapData(options);