Skip to content

Commit 4346694

Browse files
author
mhugent
committed
automatically set the project CRS in WMS layer selection dialog
git-svn-id: http://svn.osgeo.org/qgis/trunk@7384 c8812cc2-4d05-0410-92ff-de0c093fc19c
1 parent 41bc573 commit 4346694

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

src/app/qgsserversourceselect.cpp

+12
Original file line numberDiff line numberDiff line change
@@ -93,6 +93,18 @@ QgsServerSourceSelect::QgsServerSourceSelect(QgisApp * app, QWidget * parent, Qt
9393
// set up the WMS connections we already know about
9494
populateConnectionList();
9595

96+
//set the current project CRS if available
97+
long currentSRS = QgsProject::instance()->readNumEntry("SpatialRefSys", "/ProjectSRSID", -1);
98+
if(currentSRS != -1)
99+
{
100+
//convert SRS id to epsg
101+
QgsSpatialRefSys currentRefSys(currentSRS, QgsSpatialRefSys::QGIS_SRSID);
102+
if(currentRefSys.isValid())
103+
{
104+
m_Epsg = currentRefSys.epsg();
105+
}
106+
}
107+
96108
// set up the default WMS Coordinate Reference System
97109
labelCoordRefSys->setText( descriptionForEpsg(m_Epsg) );
98110
}

0 commit comments

Comments
 (0)