Skip to content

Commit 8347a4b

Browse files
committedOct 26, 2015
[BUGFIX][QGIS Server] Laye order from group in GetPrint
Since QGIS 2.8, QGIS Server rendered layers form group in reverted order.
1 parent 946e560 commit 8347a4b

File tree

1 file changed

+13
-3
lines changed

1 file changed

+13
-3
lines changed
 

‎src/server/qgswmsconfigparser.cpp

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -132,24 +132,34 @@ QgsComposition* QgsWMSConfigParser::createPrintComposition( const QString& compo
132132
if ( !layers.isEmpty() )
133133
{
134134
QStringList layerSet;
135-
QStringList wmsLayerList = layers.split( "," );
135+
QStringList wmsLayerList = layers.split( ",", QString::SkipEmptyParts );
136136
QStringList wmsStyleList;
137137

138138
if ( !styles.isEmpty() )
139139
{
140-
wmsStyleList = styles.split( "," );
140+
wmsStyleList = styles.split( ",", QString::SkipEmptyParts );
141141
}
142142

143143
for ( int i = 0; i < wmsLayerList.size(); ++i )
144144
{
145+
QString wmsLayer = wmsLayerList.at( i );
145146
QString styleName;
146147
if ( wmsStyleList.size() > i )
147148
{
148149
styleName = wmsStyleList.at( i );
149150
}
151+
152+
bool allowCaching = true;
153+
if ( wmsLayerList.count( wmsLayer ) > 1 )
154+
{
155+
allowCaching = false;
156+
}
150157

151-
Q_FOREACH ( QgsMapLayer *layer, mapLayerFromStyle( wmsLayerList.at( i ), styleName ) )
158+
QList<QgsMapLayer*> layerList = mapLayerFromStyle( wmsLayer, styleName, allowCaching );
159+
int listIndex;
160+
for ( listIndex = layerList.size() - 1; listIndex >= 0; listIndex-- )
152161
{
162+
QgsMapLayer* layer = layerList.at( listIndex );
153163
if ( layer )
154164
{
155165
layerSet.push_back( layer->id() );

0 commit comments

Comments
 (0)