You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Map stays blank after WebGL context restore with standard-satellite (Object.keys(undefined) in ModelManager.reloadModels) #13760
Chromium 151 (headless, SwiftShader); seen in production on iOS Safari, iOS in-app browsers and Android Chrome
Expected behavior
After webglcontextlost followed by webglcontextrestored, the map redraws, as it does with mapbox://styles/mapbox/standard or mapbox://styles/mapbox/satellite-streets-v12.
Actual behavior
With mapbox://styles/mapbox/standard-satellite, restoring the context throws TypeError: Cannot convert undefined or null to object and the map stays blank.
Map._contextRestored calls style.reloadModels(), which calls modelManager.reloadModels(scope) for every fragment style. For the imported basemap scope, modelManager.modelUris["basemap"] is never created because that style has no models, so load(undefined, ...) runs Object.keys(undefined). The throw skips the rest of _contextRestored (style.clearSources(), _update()), so nothing is redrawn.
A one-line fix in 3d-style/render/model_manager.ts:
The error below is thrown and the map stays blank.
Relevant log output
TypeError: Cannot convert undefined or null to object
at Object.keys ()
at ModelManager.load (3d-style/render/model_manager.ts)
at ModelManager.reloadModels (3d-style/render/model_manager.ts)
at Style.reloadModels (src/style/style.ts)
at Map._contextRestored (src/ui/map.ts)
Activity