Skip to content
Permalink
Browse files
Fix layer drawing order in server to also work in complex projects an…
…d with custom drawing order
  • Loading branch information
mhugent committed Apr 18, 2017
1 parent 33ccb8a commit 6b5a997df578a7996dc95e93690fe0a3d24e089b
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)

4 comments on commit 6b5a997

@rldhont

This comment has been minimized.

Copy link
Contributor

@rldhont rldhont replied Apr 25, 2017

Does this commit can be backported to 2.14 ? If yes, I can do it.

@andreasneumann

This comment has been minimized.

Copy link
Member

@andreasneumann andreasneumann replied May 8, 2017

And how about QGIS 3.0? Is this also an issue in QGIS 3.0?

@mhugent

This comment has been minimized.

Copy link
Contributor Author

@mhugent mhugent replied May 8, 2017

@rldhont: yes, please backport it
@andreasneumann: In 3.0, the layers are coming directly from QgsProject, so it should not be necessary there.

@rldhont

This comment has been minimized.

Copy link
Contributor

@rldhont rldhont replied May 8, 2017

@mhugent: ok, done 512f5d5

Please sign in to comment.