Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
improve legacy support for CRS/SRS in wms provider
git-svn-id: http://svn.osgeo.org/qgis/trunk@14090 c8812cc2-4d05-0410-92ff-de0c093fc19c
  • Loading branch information
jef committed Aug 16, 2010
1 parent 2bdfcad commit cd32e63
Showing 1 changed file with 3 additions and 10 deletions.
13 changes: 3 additions & 10 deletions src/providers/wms/qgswmsprovider.cpp
Expand Up @@ -1577,20 +1577,13 @@ void QgsWmsProvider::parseLayer( QDomElement const & e, QgsWmsLayerProperty& lay
{
parseKeywordList( e1, layerProperty.keywordList );
}
else if ( e1.tagName() == "SRS" )
{
layerProperty.crs.push_back( e1.text() );
}
else if ( e1.tagName() == "CRS" ) // legacy from earlier versions of WMS
else if ( e1.tagName() == "SRS" || e1.tagName() == "CRS" )
{
// CRS can contain several definitions separated by whitespace
// though this was deprecated in WMS 1.1.1
QStringList srsList = e1.text().split( QRegExp( "\\s+" ) );

QStringList::const_iterator i;
for ( i = srsList.constBegin(); i != srsList.constEnd(); ++i )
foreach( QString srs, e1.text().split( QRegExp( "\\s+" ) ) )
{
layerProperty.crs.push_back( *i );
layerProperty.crs.push_back( srs );
}
}
else if ( e1.tagName() == "LatLonBoundingBox" ) // legacy from earlier versions of WMS
Expand Down

0 comments on commit cd32e63

Please sign in to comment.