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 authored and rldhont committed Dec 13, 2016
1 parent f5c28c3 commit 28295e1
Showing 1 changed file with 18 additions and 1 deletion.
19 changes: 18 additions & 1 deletion src/server/qgswmsserver.cpp
Expand Up @@ -147,13 +147,30 @@ void QgsWMSServer::executeRequest()
}

//version
QString version = mParameters.value( "VERSION", "1.3.0" );
QString version = "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( "GetProjectSettings", Qt::CaseInsensitive ) == 0 );
if ( getProjectSettings )
{
version = "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( "GetCapabilities", Qt::CaseInsensitive ) == 0 || getProjectSettings )
{
Expand Down

0 comments on commit 28295e1

Please sign in to comment.