GeoLeaf Core API - v3.19.0
    Preparing search index...

    Interface GeoLeafMount

    The handle GeoLeaf.mount() returns — the application it mounted, and the one way to take it down again.

    interface GeoLeafMount {
        ready: Promise<void>;
        unmount(): Promise<void>;
        on<K extends (keyof GeoLeafEventMap) | (keyof GeoLeafRawEventMap)>(
            event: K,
            handler: GeoLeafEventHandler<K>,
        ): () => void;
        getMap(): IMapAdapter | null;
    }
    Index
    ready: Promise<void>

    Settles once the boot has: resolves on geoleaf:app:ready; rejects with a GeoLeafMountError when the boot fails (geoleaf:boot:failed, a provisional timeout excepted), is aborted, or when the application is unmounted before it was ready. A boot held on the attention screen (« Continue ») stays pending until the user continues.

    A rejection nobody awaits is not reported as unhandled.

    • Unmounts the application: ends its boot if it is still running, tears its modules down while the map is still alive, destroys the map and the panels, and forgets the state the boot owned — the next mount() or boot() starts the whole application again.

      Idempotent. Does nothing more on a handle a later mount() has already taken over.

      Returns Promise<void>

      Resolves once the application is torn down. A beforeBoot hook still pending holds it: the boot stops at its next step, and the hook is the host's.

    • Subscribes to a GeoLeaf event — the page's bus, the same events and types as GeoLeaf.Events.on(). Whatever is subscribed here is removed when the application is unmounted.

      A subscription made before the boot starts is attached when it does: it hears every event of THIS application, and nothing of the one it replaces.

      Type Parameters

      • K extends (keyof GeoLeafEventMap) | (keyof GeoLeafRawEventMap)

      Parameters

      • event: K

        A geoleaf:* event name.

      • handler: GeoLeafEventHandler<K>

        Receives the CustomEvent, its detail typed by the event name.

      Returns () => void

      Removes this subscription — and only it, even when the same function was also subscribed through GeoLeaf.Events.on().