Permalink
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
[BUGFIX][QGIS Server] Laye order from group in GetPrint
Since QGIS 2.8, QGIS Server rendered layers form group in reverted order.
- Loading branch information
Showing
with
13 additions
and
3 deletions.
-
+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; |
|
|
} |
|
|
|
|
|
Q_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() ); |
|
|