Skip to content
Permalink
Browse files

[Globe] Fix typos, fix model layer logic

  • Loading branch information
manisandro committed Jun 15, 2016
1 parent f9c589e commit 4ba2433692f7a8f9862043c4ddfbf131923d0b6d
Showing with 9 additions and 7 deletions.
  1. +9 −7 src/plugins/globe/globe_plugin.cpp
@@ -892,14 +892,17 @@ void GlobePlugin::updateLayers()
}
mLayerExtents.clear();

QStringList drapedLayers;
QStringList selectedLayers = mDockWidget->getSelectedLayers();

// Disconnect any previous repaintRequested signals
foreach ( const QString& layerId, mTileSource->layerSet() )
{
QgsMapLayer* mapLayer = QgsMapLayerRegistry::instance()->mapLayer( layerId );
if ( mapLayer )
disconnect( mapLayer, SIGNAL( repaintRequested() ), this, SLOT( layerChanged() ) );
if ( dynamic_cast<QgsVectorLayer*>( mapLayer ) )
connect( static_cast<QgsVectorLayer*>( mapLayer ), SIGNAL( layerTransparencyChanged( int ) ), this, SLOT( layerChanged() ) );
disconnect( static_cast<QgsVectorLayer*>( mapLayer ), SIGNAL( layerTransparencyChanged( int ) ), this, SLOT( layerChanged() ) );
}
osgEarth::ModelLayerVector modelLayers;
mMapNode->getMap()->getModelLayers( modelLayers );
@@ -909,12 +912,11 @@ void GlobePlugin::updateLayers()
if ( mapLayer )
disconnect( mapLayer, SIGNAL( repaintRequested() ), this, SLOT( layerChanged() ) );
if ( dynamic_cast<QgsVectorLayer*>( mapLayer ) )
connect( static_cast<QgsVectorLayer*>( mapLayer ), SIGNAL( layerTransparencyChanged( int ) ), this, SLOT( layerChanged() ) );
disconnect( static_cast<QgsVectorLayer*>( mapLayer ), SIGNAL( layerTransparencyChanged( int ) ), this, SLOT( layerChanged() ) );
if ( !selectedLayers.contains( QString::fromStdString( modelLayer->getName() ) ) )
mMapNode->getMap()->removeModelLayer( modelLayer );
}

QStringList drapedLayers;
QStringList selectedLayers = mDockWidget->getSelectedLayers();

Q_FOREACH ( const QString& layerId, selectedLayers )
{
QgsMapLayer* mapLayer = QgsMapLayerRegistry::instance()->mapLayer( layerId );
@@ -929,8 +931,8 @@ void GlobePlugin::updateLayers()

if ( layerConfig && ( layerConfig->renderingMode == QgsGlobeVectorLayerConfig::RenderingModeModelSimple || layerConfig->renderingMode == QgsGlobeVectorLayerConfig::RenderingModeModelAdvanced ) )
{
mMapNode->getMap()->removeModelLayer( mMapNode->getMap()->getModelLayerByName( mapLayer->id().toStdString() ) );
addModelLayer( static_cast<QgsVectorLayer*>( mapLayer ), layerConfig );
if ( !mMapNode->getMap()->getModelLayerByName( mapLayer->id().toStdString() ) )
addModelLayer( static_cast<QgsVectorLayer*>( mapLayer ), layerConfig );
}
else
{

0 comments on commit 4ba2433

Please sign in to comment.
You can’t perform that action at this time.