Skip to content

Commit

Permalink
Backward support for parameters 'MTVER' and 'capabilities' from WMS 1…
Browse files Browse the repository at this point in the history
….0.0 is required for WMS 1.1.1
  • Loading branch information
mhugent committed Dec 9, 2016
1 parent 48f43b0 commit fdf2a9d
Showing 1 changed file with 19 additions and 1 deletion.
20 changes: 19 additions & 1 deletion src/server/qgswmsserver.cpp
Expand Up @@ -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 )
{
Expand Down

0 comments on commit fdf2a9d

Please sign in to comment.