Skip to content

Commit bf37617

Browse files
author
jef
committed
improve legacy support for CRS/SRS in wms provider
git-svn-id: http://svn.osgeo.org/qgis/trunk/qgis@14090 c8812cc2-4d05-0410-92ff-de0c093fc19c
1 parent 3c435c5 commit bf37617

File tree

1 file changed

+3
-10
lines changed

1 file changed

+3
-10
lines changed

src/providers/wms/qgswmsprovider.cpp

+3-10
Original file line numberDiff line numberDiff line change
@@ -1577,20 +1577,13 @@ void QgsWmsProvider::parseLayer( QDomElement const & e, QgsWmsLayerProperty& lay
15771577
{
15781578
parseKeywordList( e1, layerProperty.keywordList );
15791579
}
1580-
else if ( e1.tagName() == "SRS" )
1581-
{
1582-
layerProperty.crs.push_back( e1.text() );
1583-
}
1584-
else if ( e1.tagName() == "CRS" ) // legacy from earlier versions of WMS
1580+
else if ( e1.tagName() == "SRS" || e1.tagName() == "CRS" )
15851581
{
15861582
// CRS can contain several definitions separated by whitespace
15871583
// though this was deprecated in WMS 1.1.1
1588-
QStringList srsList = e1.text().split( QRegExp( "\\s+" ) );
1589-
1590-
QStringList::const_iterator i;
1591-
for ( i = srsList.constBegin(); i != srsList.constEnd(); ++i )
1584+
foreach( QString srs, e1.text().split( QRegExp( "\\s+" ) ) )
15921585
{
1593-
layerProperty.crs.push_back( *i );
1586+
layerProperty.crs.push_back( srs );
15941587
}
15951588
}
15961589
else if ( e1.tagName() == "LatLonBoundingBox" ) // legacy from earlier versions of WMS

0 commit comments

Comments
 (0)