Skip to content
Permalink
Browse files
Merge pull request #1419 from marcel-dancak/master
Mapserver's GetProjectSettings/GetFeatureInfo bug-fixes
  • Loading branch information
mhugent committed Jun 6, 2014
2 parents 4850111 + bf82848 commit 126c3d319c4ca8f7a0fcb46dd3b9a3118eb53a27
Showing with 13 additions and 2 deletions.
  1. +6 −1 src/mapserver/qgsserverprojectparser.cpp
  2. +7 −1 src/mapserver/qgswmsserver.cpp
@@ -649,9 +649,14 @@ void QgsServerProjectParser::addLayerProjectSettings( QDomElement& layerElem, QD
displayField = vLayer->attributeDisplayName( idx );
}
QDomElement attributeElem = doc.createElement( "Attribute" );
attributeElem.setAttribute( "name", vLayer->attributeDisplayName( idx ) );
attributeElem.setAttribute( "name", field.name() );
attributeElem.setAttribute( "type", QVariant::typeToName( field.type() ) );
attributeElem.setAttribute( "typeName", field.typeName() );
QString alias = vLayer->attributeAlias( idx );
if ( !alias.isEmpty() )
{
attributeElem.setAttribute( "alias", alias );
}

//edit type to text
attributeElem.setAttribute( "editType", vLayer->editorWidgetV2( idx ) );
@@ -2869,12 +2869,18 @@ QDomElement QgsWMSServer::createFeatureGML(
}
}

//read all attribute values from the feature
//read all allowed attribute values from the feature
const QSet<QString>& excludedAttributes = layer->excludeAttributesWMS();
QgsAttributes featureAttributes = feat->attributes();
const QgsFields* fields = feat->fields();
for ( int i = 0; i < fields->count(); ++i )
{
QString attributeName = fields->at( i ).name();
//skip attribute if it is explicitly excluded from WMS publication
if ( excludedAttributes.contains( attributeName ) )
{
continue;
}
QDomElement fieldElem = doc.createElement( "qgs:" + attributeName.replace( QString( " " ), QString( "_" ) ) );
QString fieldTextString = featureAttributes[i].toString();
if ( layer )

0 comments on commit 126c3d3

Please sign in to comment.