Skip to content
Permalink
Browse files

Show print information only in GetProjectSettings, not in caabilities…

…. Better handling of layer order
  • Loading branch information
Marco Hugentobler
Marco Hugentobler committed Sep 7, 2012
1 parent 0d61dfe commit 2c897f7768d8f4b567fbbc270ed0f77abeff5b97
Showing with 6 additions and 10 deletions.
  1. +5 −9 src/mapserver/qgsprojectparser.cpp
  2. +1 −1 src/mapserver/qgswmsserver.cpp
@@ -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 )
{
@@ -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" );
@@ -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 );
}

0 comments on commit 2c897f7

Please sign in to comment.
You can’t perform that action at this time.