Skip to content

Commit

Permalink
[BUGFIX][QGIS Server] Laye order from group in GetPrint
Browse files Browse the repository at this point in the history
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 b0f6e30 commit 8b9623d
Showing 1 changed file with 13 additions and 3 deletions.
16 changes: 13 additions & 3 deletions src/server/qgswmsconfigparser.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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() );
Expand Down

0 comments on commit 8b9623d

Please sign in to comment.