QGISmapserverGetLegendGraphic_3.patch

bug in last patch - Marco Lechner, 2013-04-05 02:18 PM

Download (1.46 KB)

View differences:

src/mapserver/qgswmsserver.cpp
256 256
  {
257 257
    return 0;
258 258
  }
259
  if ( !mParameterMap.contains( "LAYER" ) && !mParameterMap.contains( "LAYERS" ))
260
    {
261
	  throw QgsMapServiceException( "LayerNotSpecified", "Layer is mandatory for GetLegendGraphic operation" );
262
    }
263
  if ( !mParameterMap.contains( "FORMAT" ) )
264
    {
265
	  throw QgsMapServiceException( "FormatNotSpecified", "Format is mandatory for GetLegendGraphic operation" );
266
    }
259 267

  
260 268
  QStringList layersList, stylesList;
261 269

  
......
1134 1142

  
1135 1143
int QgsWMSServer::readLayersAndStyles( QStringList& layersList, QStringList& stylesList ) const
1136 1144
{
1137
  //get layer and style lists from the parameters
1138
  layersList = mParameterMap.value( "LAYERS" ).split( "," );
1139
  stylesList = mParameterMap.value( "STYLES" ).split( "," );
1145
  //get layer and style lists from the parameters trying LAYERS and LAYER as well as STYLE and STYLES for GetLegendGraphic compatibility
1146
  layersList = mParameterMap.value( "LAYER" ).split( "," );
1147
  layersList = layersList + mParameterMap.value( "LAYERS" ).split( "," );
1148
  stylesList = mParameterMap.value( "STYLE" ).split( "," );
1149
  stylesList = stylesList + mParameterMap.value( "STYLES" ).split( "," );
1140 1150

  
1141 1151
  return 0;
1142 1152
}