Skip to content

Commit

Permalink
[Globe] Delay initial layer update to workaround some mysterious open…
Browse files Browse the repository at this point in the history
…gl errors
  • Loading branch information
manisandro committed Jun 15, 2016
1 parent 7ddb292 commit f9c589e
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/plugins/globe/globe_plugin.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -371,8 +371,6 @@ void GlobePlugin::run()
mQgisMapLayer = new osgEarth::ImageLayer( options, mTileSource );
map->addImageLayer( mQgisMapLayer );

// Add layers to the map
updateLayers();

// Create the frustum highlight callback
mFrustumHighlightCallback = new QgsGlobeFrustumHighlightCallback(
Expand Down Expand Up @@ -417,9 +415,13 @@ void GlobePlugin::run()
// which appear when launching the globe a second time:
// Delay applySettings one event loop iteration, i.e. one update call of the GL canvas
QTimer* timer = new QTimer();
QTimer* timer2 = new QTimer();
connect( timer, SIGNAL( timeout() ), timer, SLOT( deleteLater() ) );
connect( timer2, SIGNAL( timeout() ), timer2, SLOT( deleteLater() ) );
connect( timer, SIGNAL( timeout() ), this, SLOT( applySettings() ) );
connect( timer2, SIGNAL( timeout() ), this, SLOT( updateLayers() ) );
timer->start( 0 );
timer2->start( 100 );
}

void GlobePlugin::showSettings()
Expand Down

0 comments on commit f9c589e

Please sign in to comment.