Skip to content

Commit

Permalink
apply #7521
Browse files Browse the repository at this point in the history
  • Loading branch information
jef-n committed Apr 6, 2013
1 parent 04119d8 commit d62d88e
Showing 1 changed file with 13 additions and 3 deletions.
16 changes: 13 additions & 3 deletions src/mapserver/qgswmsserver.cpp
Expand Up @@ -256,6 +256,14 @@ QImage* QgsWMSServer::getLegendGraphics()
{
return 0;
}
if ( !mParameterMap.contains( "LAYER" ) && !mParameterMap.contains( "LAYERS" ) )
{
throw QgsMapServiceException( "LayerNotSpecified", "LAYER is mandatory for GetLegendGraphic operation" );
}
if ( !mParameterMap.contains( "FORMAT" ) )
{
throw QgsMapServiceException( "FormatNotSpecified", "FORMAT is mandatory for GetLegendGraphic operation" );
}

QStringList layersList, stylesList;

Expand Down Expand Up @@ -1134,9 +1142,11 @@ int QgsWMSServer::configureMapRender( const QPaintDevice* paintDevice ) const

int QgsWMSServer::readLayersAndStyles( QStringList& layersList, QStringList& stylesList ) const
{
//get layer and style lists from the parameters
layersList = mParameterMap.value( "LAYERS" ).split( "," );
stylesList = mParameterMap.value( "STYLES" ).split( "," );
//get layer and style lists from the parameters trying LAYERS and LAYER as well as STYLE and STYLES for GetLegendGraphic compatibility
layersList = mParameterMap.value( "LAYER" ).split( "," );
layersList = layersList + mParameterMap.value( "LAYERS" ).split( "," );
stylesList = mParameterMap.value( "STYLE" ).split( "," );
stylesList = stylesList + mParameterMap.value( "STYLES" ).split( "," );

return 0;
}
Expand Down

0 comments on commit d62d88e

Please sign in to comment.