qgis / qgis-js

QGIS core ported to WebAssembly to run it on the web platform
https://qgis.github.io/qgis-js
GNU General Public License v2.0
170 stars 9 forks source link

Loading a WMS/WMTS layer causes infinite loop #2

Open wonder-sk opened 1 year ago

wonder-sk commented 1 year ago

If the QGIS project uses a WMS / WMTS layer, the project loading will get stuck, with this warning being emitted all the time:

QEventLoop::WaitForMoreEvents is not supported on the main thread without asyncify

This is likely due to the fact that the WMS provider is doing a synchronous blocking GetCapabilities call in the constructor.

wonder-sk commented 1 year ago

Given that we're using QGIS 3.32 in the builds, we could try to add QgsProviderMetadata::ParallelCreateProvider to WMS metadata (QgsWmsProviderMetadata::providerCapabilities()) to get the provider loaded in a worker thread, rather than creating it in the main thread. (But we'll probably still be affected by networking issues as in #3)