Skip to content
Permalink
Browse files

Backward support for parameters 'MTVER' and 'capabilities' from WMS 1…

….0.0 is required for WMS 1.1.1
  • Loading branch information
mhugent committed Dec 9, 2016
1 parent 48f43b0 commit fdf2a9dcb7989911c931e0bff7f076f245285645
Showing with 19 additions and 1 deletion.
  1. +19 −1 src/server/qgswmsserver.cpp
@@ -150,13 +150,31 @@ void QgsWmsServer::executeRequest()
}

//version
QString version = mParameters.value( QStringLiteral( "VERSION" ), QStringLiteral( "1.3.0" ) );
QString version( QStringLiteral( "1.3.0" ) );
if ( mParameters.contains( "VERSION" ) )
{
version = mParameters.value( "VERSION" );
}
else if ( mParameters.contains( "WMTVER" ) ) //WMTVER needs to be supported by WMS 1.1.1 for backwards compatibility with WMS 1.0.0
{
version = mParameters.value( "WMTVER" );
}


bool getProjectSettings = ( request.compare( QLatin1String( "GetProjectSettings" ), Qt::CaseInsensitive ) == 0 );
if ( getProjectSettings )
{
version = QStringLiteral( "1.3.0" ); //getProjectSettings extends WMS 1.3.0 capabilities
}

if ( version == "1.1.1" )
{
if ( request.compare( "capabilities", Qt::CaseInsensitive ) == 0 )
{
request = QString( "GetCapabilities" );
}
}

//GetCapabilities
if ( request.compare( QLatin1String( "GetCapabilities" ), Qt::CaseInsensitive ) == 0 || getProjectSettings )
{

0 comments on commit fdf2a9d

Please sign in to comment.
You can’t perform that action at this time.