Interface HonuaMapProps

Props for HonuaMap.

interface HonuaMapProps {
    children?: ReactNode;
    className?: string;
    loadOptions?: Omit<LoadMapPackageOptions, "client">;
    map?: MaplibreMap;
    mapLibre?: MapLibreGlModule;
    mapOptions?: Partial<Omit<MapLibreMapOptions, "container">>;
    onError?: ((error: unknown) => void);
    onRuntime?: ((runtime: HonuaMapRuntime) => void);
    package: HonuaMapPackage;
    style?: CSSProperties;
}

Properties

children?: ReactNode
className?: string
loadOptions?: Omit<LoadMapPackageOptions, "client">

Extra options forwarded to loadMapPackage. client is taken from the provider; a popupFactory is defaulted from the maplibre module when one is available so HonuaPopup works out of the box.

Attach to an existing, externally-owned map instead of creating one. When set, HonuaMap never removes the map on unmount (the owner is responsible) — it only disposes the runtime.

mapLibre?: MapLibreGlModule

The maplibre-gl module. Provide it to avoid a dynamic import (and to pin the exact version). Ignored when map is supplied.

mapOptions?: Partial<Omit<MapLibreMapOptions, "container">>

Extra options merged into the maplibre-gl Map constructor when HonuaMap owns the map (container and style are managed for you).

onError?: ((error: unknown) => void)

Called if map creation or package loading fails.

onRuntime?: ((runtime: HonuaMapRuntime) => void)

Called once the runtime is ready.

The MapPackage to compose onto the map.

style?: CSSProperties