Skip to content

Commit 2bf7c5b

Browse files
author
jef
committedNov 7, 2007
fix for misprojected wms layers after project load
git-svn-id: http://svn.osgeo.org/qgis/trunk/qgis@7350 c8812cc2-4d05-0410-92ff-de0c093fc19c
1 parent facacf8 commit 2bf7c5b

File tree

1 file changed

+7
-5
lines changed

1 file changed

+7
-5
lines changed
 

‎src/core/qgsmaplayer.cpp

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -142,10 +142,12 @@ bool QgsMapLayer::readXML( QDomNode & layer_node )
142142
QDomElement mne = mnl.toElement();
143143
mDataSource = mne.text();
144144

145-
// Set a SRS (any will do) so that we don't ask the user.
146-
// We will overwrite whatever GDAL etc picks up anway
145+
// Set the SRS so that we don't ask the user.
146+
// Make it the saved SRS to have WMS layer projected correctly.
147+
// We will still overwrite whatever GDAL etc picks up anyway
147148
// further down this function.
148-
mSRS->createFromSrsId(GEOSRS_ID);
149+
QDomNode srsNode = layer_node.namedItem("srs");
150+
mSRS->readXML(srsNode);
149151

150152
// now let the children grab what they need from the DOM node.
151153
if (!readXML_( layer_node ))
@@ -186,8 +188,8 @@ bool QgsMapLayer::readXML( QDomNode & layer_node )
186188
mne = mnl.toElement();
187189
setLayerName( mne.text() );
188190

189-
//read srs
190-
QDomNode srsNode = layer_node.namedItem("srs");
191+
// overwrite srs
192+
// FIXME: is this necessary?
191193
mSRS->readXML(srsNode);
192194

193195
//read transparency level

0 commit comments

Comments
 (0)
Please sign in to comment.