Skip to content
Permalink
Browse files

[BUGFIX][QGIS Server] Laye order from group in GetPrint

Since QGIS 2.8, QGIS Server rendered layers form group in reverted order.

Conflicts:
	src/server/qgswmsconfigparser.cpp
  • Loading branch information
rldhont committed Oct 26, 2015
1 parent 972104c commit de3d7eb9574b42a8a34bf30264715e32b17bc156
Showing with 13 additions and 3 deletions.
  1. +13 −3 src/server/qgswmsconfigparser.cpp
@@ -132,24 +132,34 @@ QgsComposition* QgsWMSConfigParser::createPrintComposition( const QString& compo
if ( !layers.isEmpty() )
{
QStringList layerSet;
QStringList wmsLayerList = layers.split( "," );
QStringList wmsLayerList = layers.split( ",", QString::SkipEmptyParts );
QStringList wmsStyleList;

if ( !styles.isEmpty() )
{
wmsStyleList = styles.split( "," );
wmsStyleList = styles.split( ",", QString::SkipEmptyParts );
}

for ( int i = 0; i < wmsLayerList.size(); ++i )
{
QString wmsLayer = wmsLayerList.at( i );
QString styleName;
if ( wmsStyleList.size() > i )
{
styleName = wmsStyleList.at( i );
}

bool allowCaching = true;
if ( wmsLayerList.count( wmsLayer ) > 1 )
{
allowCaching = false;
}

foreach ( QgsMapLayer *layer, mapLayerFromStyle( wmsLayerList.at( i ), styleName ) )
QList<QgsMapLayer*> layerList = mapLayerFromStyle( wmsLayer, styleName, allowCaching );
int listIndex;
for ( listIndex = layerList.size() - 1; listIndex >= 0; listIndex-- )
{
QgsMapLayer* layer = layerList.at( listIndex );
if ( layer )
{
layerSet.push_back( layer->id() );

0 comments on commit de3d7eb

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