MapLibre Black Screen on Mobile App Resume: Debugging WebGL Context Loss #287
Unanswered
BenOnTrack
asked this question in
Q&A
Replies: 1 comment 2 replies
-
|
Not that I know of but I haven't used it extensively on mobile so this is a bit outside my experience. Something around the |
Beta Was this translation helpful? Give feedback.
2 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Hi,
I'm building a Progressive Web App (PWA) using maplibre-svelte, and I've run into a strange issue on mobile devices. When I switch away from my app to another app and then return, the map sometimes shows a completely black screen — but only at the zoom level I was on before switching. If I zoom in or out, the map renders correctly again.
The map itself is still interactive (I can pan and zoom), so it seems like the WebGL context is partially lost or corrupted. I initially thought this might be related to Svelte's onDestroy lifecycle hook, but since the component isn't being unmounted, that doesn't seem to be the case.
I'm now considering using the visibilitychange event to detect when the app becomes active again and trigger a map refresh or reinitialization. Has anyone dealt with similar issues in MapLibre or Svelte PWAs? Is there a cleaner way to handle WebGL context loss on mobile?
Beta Was this translation helpful? Give feedback.
All reactions