Skip to content

Commit ae906b5

Browse files
committedSep 15, 2015
[SERVER][BUGFIX] Layer order from group
If custom order is not enabled and a group is requested, layers was added in the DOM element order. The default endering order is the reverse. To fix this issue, QgsWMSProjectParser::addLayersFromGroup has to read group element children from end (bottom) to start (top).
1 parent 0701313 commit ae906b5

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed
 

‎src/server/qgswmsprojectparser.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -258,7 +258,8 @@ void QgsWMSProjectParser::addLayersFromGroup( const QDomElement& legendGroupElem
258258
{
259259
QMap< int, QDomElement > layerOrderList;
260260
QDomNodeList groupElemChildren = legendGroupElem.childNodes();
261-
for ( int i = 0; i < groupElemChildren.size(); ++i )
261+
// for rendering layers has to be add from bottom (end) to top (start)
262+
for ( int i = groupElemChildren.size()-1; i >= 0 ; --i )
262263
{
263264
QDomElement elem = groupElemChildren.at( i ).toElement();
264265
if ( elem.tagName() == "legendgroup" )

0 commit comments

Comments
 (0)
Please sign in to comment.