Hold map requests

Hold the map's tile requests behind a toggle, then release them

View on GitHub
SDK 1.0.0-rc.7

Turn the hold on and pan: the held tiles pile up in the panel and the edge you uncover stays blank, until you turn the hold off and they load.

  • transformRequest gets each request once the SDK has built it, URL, headers and credentials included, so the hook only decides when it goes.
  • Returning a promise holds the request on the main thread, before MapLibre’s workers fetch the tile, the same way you wait for a proxy session.
  • The hook stays in place through setLanguage and setGeopoliticalView.

Related examples