Skip to content
Permalink
Browse files

apply #7521

  • Loading branch information
jef-n committed Apr 6, 2013
1 parent 04119d8 commit d62d88ed03cb0b2008c28bc6bdc2c50d73e30f5a
Showing with 13 additions and 3 deletions.
  1. +13 −3 src/mapserver/qgswmsserver.cpp
@@ -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;

@@ -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;
}

0 comments on commit d62d88e

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