Skip to content

Commit

Permalink
use project projections instead of WGS84 for WMS crs preselection (fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
jef-n committed Jan 3, 2013
1 parent 5fefe38 commit a575711
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 4 deletions.
10 changes: 6 additions & 4 deletions src/providers/wms/qgswmssourceselect.cpp
Expand Up @@ -59,6 +59,7 @@ QgsWMSSourceSelect::QgsWMSSourceSelect( QWidget * parent, Qt::WFlags fl, bool ma
, mManagerMode( managerMode )
, mEmbeddedMode( embeddedMode )
, mCurrentTileset( 0 )
, mDefaultCRS( GEO_EPSG_CRS_AUTHID )
{
setupUi( this );

Expand Down Expand Up @@ -117,7 +118,7 @@ QgsWMSSourceSelect::QgsWMSSourceSelect( QWidget * parent, Qt::WFlags fl, bool ma
QgsCoordinateReferenceSystem currentRefSys( currentCRS, QgsCoordinateReferenceSystem::InternalCrsId );
if ( currentRefSys.isValid() )
{
mCRS = currentRefSys.authid();
mDefaultCRS = mCRS = currentRefSys.authid();
}
}

Expand Down Expand Up @@ -409,6 +410,8 @@ bool QgsWMSSourceSelect::populateLayerList( QgsWmsProvider *wmsProvider )
lstLayers->expandItem( lstLayers->topLevelItem( 0 ) );
}

on_lstLayers_itemSelectionChanged();

return true;
}

Expand Down Expand Up @@ -741,7 +744,6 @@ void QgsWMSSourceSelect::on_lstLayers_itemSelectionChanged()
mCurrentSelection = lstLayers->selectedItems();
lstLayers->blockSignals( false );


// selected layers with styles
QStringList layers;
QStringList styles;
Expand Down Expand Up @@ -801,7 +803,7 @@ void QgsWMSSourceSelect::on_lstLayers_itemSelectionChanged()
defaultCRS = *it;

// prefer value of DEFAULT_GEO_EPSG_CRS_ID if available
if ( *it == GEO_EPSG_CRS_AUTHID )
if ( *it == mDefaultCRS )
defaultCRS = *it;
}

Expand All @@ -813,7 +815,7 @@ void QgsWMSSourceSelect::on_lstLayers_itemSelectionChanged()
}

}
else if ( mCRSs.isEmpty() )
else if ( layers.isEmpty() || mCRSs.isEmpty() )
{
mCRS = "";
labelCoordRefSys->setText( "" );
Expand Down
3 changes: 3 additions & 0 deletions src/providers/wms/qgswmssourceselect.h
Expand Up @@ -133,6 +133,9 @@ class QgsWMSSourceSelect : public QDialog, private Ui::QgsWMSSourceSelectBase
//! Selected CRS
QString mCRS;

//! Default CRS
QString mDefaultCRS;

//! Common CRSs for selected layers
QSet<QString> mCRSs;

Expand Down

0 comments on commit a575711

Please sign in to comment.