Skip to content
Permalink
Browse files
Merge pull request #4369 from mhugent/server_layerorder
Fix layer drawing order in server to also work in complex projects and with custom drawing order
  • Loading branch information
mhugent committed Apr 18, 2017
2 parents 14d96fc + 6b5a997 commit 1cc2c410ac7228fc27f9d088b3146560a5c903f0
Showing with 2 additions and 2 deletions.
  1. +1 −1 src/server/qgsserverprojectparser.cpp
  2. +1 −1 src/server/qgswmsprojectparser.cpp
@@ -1216,7 +1216,7 @@ bool QgsServerProjectParser::findUseLayerIDs() const
void QgsServerProjectParser::layerFromLegendLayer( const QDomElement& legendLayerElem, QMap< int, QgsMapLayer*>& layers, bool useCache ) const
{
QString id = legendLayerElem.firstChild().firstChild().toElement().attribute( "layerid" );
int drawingOrder = updateLegendDrawingOrder() ? -1 : mCustomLayerOrder.indexOf( id );
int drawingOrder = updateLegendDrawingOrder() ? mCustomLayerOrder.indexOf( id ) : -1;

QHash< QString, QDomElement >::const_iterator layerIt = mProjectLayerElementsById.find( id );
if ( layerIt != mProjectLayerElementsById.constEnd() )
@@ -203,7 +203,7 @@ QList<QgsMapLayer*> QgsWMSProjectParser::mapLayerFromStyle( const QString& lName
if ( !groupElement.isNull() )
{
addLayersFromGroup( groupElement, layers, useCache );
return QgsConfigParserUtils::layerMapToList( layers, mProjectParser->updateLegendDrawingOrder() );
return QgsConfigParserUtils::layerMapToList( layers, false );
}

//still not found. Check if it is a single embedded layer (embedded layers are not contained in mProjectLayerElementsByName)

0 comments on commit 1cc2c41

Please sign in to comment.