OsmTravel / OsmGo

Osm Go !
https://osmgo.com/
MIT License
109 stars 15 forks source link

Map rendering lost when switching apps #123

Open dotcs opened 2 years ago

dotcs commented 2 years ago

I'm using the PWA app on Android. Sometimes, I guess it happens when the smartphone is short on memory, the map rendering is lost when switching between apps. So a typical scenario that I have experienced multiple times is that the PWA works fine but when I switch to my podcast player and later back to OsmGo, I can only see the control buttons and my location but not any map or any markers on the map.

I'll try to make a screenshot next time this happens and attach it to this issue. see below for a picture

Has anyone else experienced those issues?

I'm using a Samsung A31 with Android 11 and the Brave Browser (Brave 1.39.123, Chromium 102.0.5005.125).

Screenshot that shows the missing map ![SmartSelect_20220625-001150_Brave.jpg](https://user-images.githubusercontent.com/3976183/175702609-86cd0e9b-d713-460e-a967-b27245d1bc9f.jpg)
dotcs commented 2 years ago

I found an issue in the mapbox-gl-js repo that might be the root cause for this issue.

Chrome fires a couple of error messages in the console when this issue occurs:

WebGL: CONTEXT_LOST_WEBGL: loseContext: context lost
WebGL: INVALID_OPERATION: bindBuffer: object does not belong to this context
WebGL: INVALID_OPERATION: bindTexture: object does not belong to this context
[.WebGL-0x200844600]GL ERROR :GL_INVALID_OPERATION : glDrawElements: bound to target 0x8893 : no buffer
WebGL: INVALID_VALUE: bufferSubData: buffer overflow