Function ensureOfflineRegionProtocol

  • Register the offline-region:// protocol on MapLibre if it is not registered already. Idempotent per scheme, exactly like the PMTiles registration: several maps loading the same region concurrently share one registration.

    Because MapLibre's protocol table is process-global, the first handler wins for a given scheme. A host that needs to serve a different region on the same scheme must resetOfflineRegionProtocol first, or register the second region under its own scheme.

    Returns Promise<void>