Fixed the issue with delayed layer initialization in some cases
@@ -788,10 +788,15 @@ namespace carto {
// If screen size has been set, load the layers, otherwise wait for the onSurfaceChanged method
// which will also start the cull worker
if (_surfaceCreated) {
+ // If layer not yet initialized, Force the layer to be initialized (and then culled) in the UI thread
+ if (!layer->isSurfaceCreated()) {
+ requestRedraw();
+ } else {
int delayTime = layer->getCullDelay();
_cullWorker->init(layer, delay ? delayTime : 0);
}
}
+ }
void MapRenderer::viewChanged(bool delay) {
for (const std::shared_ptr<Layer>& layer : _layers->getAll()) {
