Function HonuaMapProvider

  • Experimental

    Publish an externally-owned MapLibre map to the Honua map-attached hooks and components below it (HonuaSourceLayer, useMountedSource, selection bindings). Use this when another library owns the map — e.g. @vis.gl/react-maplibre's <Map> — and Honua should only mount data onto it. The provider never mutates or removes the map.

    Parameters

    Returns ReactNode

    function Overlay() {
    const { current } = useMap(); // @vis.gl/react-maplibre
    return (
    <HonuaMapProvider map={current?.getMap() ?? null}>
    <HonuaSourceLayer source={source} hover />
    </HonuaMapProvider>
    );
    }