Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Consider attribute aliases and hidden attributes in GetProjectSetting…
…s. Don't show WFS layers in GetCapabilities
  • Loading branch information
mhugent committed Oct 19, 2012
1 parent 07d3378 commit f0a8c6d
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/mapserver/qgsprojectparser.cpp
Expand Up @@ -583,6 +583,7 @@ void QgsProjectParser::addLayerProjectSettings( QDomElement& layerElem, QDomDocu
if ( currentLayer->type() == QgsMapLayer::VectorLayer )
{
QgsVectorLayer* vLayer = static_cast<QgsVectorLayer*>( currentLayer );
const QSet<QString>& excludedAttributes = vLayer->excludeAttributesWMS();

//displayfield
layerElem.setAttribute( "displayField", vLayer->displayField() );
Expand All @@ -593,8 +594,12 @@ void QgsProjectParser::addLayerProjectSettings( QDomElement& layerElem, QDomDocu
QgsFieldMap::const_iterator fieldIt = layerFields.constBegin();
for ( ; fieldIt != layerFields.constEnd(); ++fieldIt )
{
if ( excludedAttributes.contains( fieldIt->name() ) )
{
continue;
}
QDomElement attributeElem = doc.createElement( "Attribute" );
attributeElem.setAttribute( "name", fieldIt->name() );
attributeElem.setAttribute( "name", vLayer->attributeDisplayName( fieldIt.key() ) );
attributeElem.setAttribute( "type", QVariant::typeToName( fieldIt->type() ) );

//edit type to text
Expand Down
3 changes: 3 additions & 0 deletions src/mapserver/qgswmsserver.cpp
Expand Up @@ -209,7 +209,10 @@ QDomDocument QgsWMSServer::getCapabilities( QString version, bool fullProjectInf
{
//Insert <ComposerTemplate> elements derived from wms:_ExtendedCapabilities
mConfigParser->printCapabilities( capabilityElement, doc );
}

if ( mConfigParser && fullProjectInformation )
{
//WFS layers
QStringList wfsLayers = mConfigParser->wfsLayerNames();
if ( wfsLayers.size() > 0 )
Expand Down

0 comments on commit f0a8c6d

Please sign in to comment.