Closed Noznoc closed 3 years ago
Mapbox provides numerous built-in map events relating to processing source data. See mapbox-gl api docs for additional information.
Examples of map data events: data, dataloading, sourcedata, and souredataloading.
According to map data event documentation, data events have a property isSourceLoaded
which could be used in a condition to then continue loading the next source data file. Once all source data has been loaded, you could then add map layers which have sources.
Added mapbox sourcedata event to the map module (see commit 36b1cd36afe7becbccdec5604e1cf496fb3bd9fb). Now when making an application a developer can load each data source, and confirm when the source is loaded before using it.
Robert: