Skip to content

Commit

Permalink
Fix layer drawing order in server to also work in complex projects an…
Browse files Browse the repository at this point in the history
…d with custom drawing order
  • Loading branch information
mhugent committed Apr 18, 2017
1 parent 33ccb8a commit 6b5a997
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/server/qgsserverprojectparser.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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() )
Expand Down
2 changes: 1 addition & 1 deletion src/server/qgswmsprojectparser.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

4 comments on commit 6b5a997

@rldhont
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

@andreasneumann
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

@mhugent
Copy link
Contributor Author

@mhugent mhugent commented on 6b5a997 May 8, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

@rldhont
Copy link
Contributor

@rldhont rldhont commented on 6b5a997 May 8, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@mhugent: ok, done 512f5d5

Please sign in to comment.