Skip to content

Commit

Permalink
Show print information only in GetProjectSettings, not in caabilities…
Browse files Browse the repository at this point in the history
…. Better handling of layer order
  • Loading branch information
Marco Hugentobler committed Sep 7, 2012
1 parent 0d61dfe commit 2c897f7
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 10 deletions.
14 changes: 5 additions & 9 deletions src/mapserver/qgsprojectparser.cpp
Expand Up @@ -1266,9 +1266,6 @@ void QgsProjectParser::printCapabilities( QDomElement& parentElement, QDomDocume
}

QDomElement composerTemplatesElem = doc.createElement( "ComposerTemplates" );
composerTemplatesElem.setAttribute( "xmlns:wms", "http://www.opengis.net/wms" );
composerTemplatesElem.setAttribute( "xmlns:xsi", "http://www.w3.org/2001/XMLSchema-instance" );
composerTemplatesElem.setAttribute( "xsi:type", "wms:_ExtendedCapabilities" );

for ( int i = 0; i < composerNodeList.size(); ++i )
{
Expand Down Expand Up @@ -1734,19 +1731,18 @@ void QgsProjectParser::addDrawingOrder( QDomElement& parentElem, QDomDocument& d
}
else
{
QVector<QString> orderedLayerNames;
orderedLayerNames.resize( layerNodeList.size() );
QMap<int, QString> orderedLayerNames;
for ( int i = 0; i < layerNodeList.size(); ++i )
{
QString layerName = layerNodeList.at( i ).toElement().attribute( "name" );
int order = layerNodeList.at( i ).toElement().attribute( "drawingOrder" ).toInt();
orderedLayerNames[order] = layerName;
orderedLayerNames.insert( order, layerName );
}

QVector<QString>::const_iterator vectorIt = orderedLayerNames.constBegin();
for ( ; vectorIt != orderedLayerNames.constEnd(); ++vectorIt )
QMap<int, QString>::const_iterator orderIt = orderedLayerNames.constBegin();
for ( ; orderIt != orderedLayerNames.constEnd(); ++orderIt )
{
layerList.prepend( *vectorIt );
layerList.prepend( *orderIt );
}
}
QDomElement layerDrawingOrderElem = doc.createElement( "LayerDrawingOrder" );
Expand Down
2 changes: 1 addition & 1 deletion src/mapserver/qgswmsserver.cpp
Expand Up @@ -206,7 +206,7 @@ QDomDocument QgsWMSServer::getCapabilities( QString version, bool fullProjectInf
capabilityElement.appendChild( elem );

//Insert <ComposerTemplate> elements derived from wms:_ExtendedCapabilities
if ( mConfigParser )
if ( mConfigParser && fullProjectInformation )
{
mConfigParser->printCapabilities( capabilityElement, doc );
}
Expand Down

0 comments on commit 2c897f7

Please sign in to comment.