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
One of the biggest hurdles when adding terrain to an existing style is that we need to wait for the map load event first, and only then we can add the terrain source and set the terrain options. This is problematic both ergonomically (it's annoying to use map.on('load', () => { ... } constantly in even basic examples), and in terms of performance, since terrain tiles don't start loading until all the vector tiles finished loading and rendering.
We should investigate whether it's possible to improve the style mechanism so that:
sources and layers could be added lazily, without waiting for load, so that their incorporation into the style would be deferred until it's loaded (if loading is in progress) instead of throwing and error
lazily loaded sources eagerly initialize the source cache and start loading tiles before the map has finished loading.
The text was updated successfully, but these errors were encountered:
On a related note, loving the 3D terrain features... Trying to add those (example code works well), but then struggling when switching styles. Basically, using map.on('load', () => { ... } works fine initially, but then when setting a new style the terrain source is lost and attempts to re-add get lost amongst waiting for new style to fully load (which has always been a tricky endeavor). Any idea on how to handle this better? Or... Possible to include the terrain source in Mapbox Studio defined styles?
sources and layers could be added lazily, without waiting for load, so that their incorporation into the style would be deferred until it's loaded (if loading is in progress) instead of throwing and error
Yes, please. Anything would be better than "Style is not done loading". 🙏
Linking to the growing back catalog of discussion: #9779#8691#8765
One of the biggest hurdles when adding terrain to an existing style is that we need to wait for the map
load
event first, and only then we can add the terrain source and set the terrain options. This is problematic both ergonomically (it's annoying to usemap.on('load', () => { ... }
constantly in even basic examples), and in terms of performance, since terrain tiles don't start loading until all the vector tiles finished loading and rendering.We should investigate whether it's possible to improve the style mechanism so that:
The text was updated successfully, but these errors were encountered: