File tree Expand file tree Collapse file tree 1 file changed +7
-1
lines changed Expand file tree Collapse file tree 1 file changed +7
-1
lines changed Original file line number Diff line number Diff line change @@ -2868,12 +2868,18 @@ QDomElement QgsWMSServer::createFeatureGML(
2868
2868
}
2869
2869
}
2870
2870
2871
- // read all attribute values from the feature
2871
+ // read all allowed attribute values from the feature
2872
+ const QSet<QString>& excludedAttributes = layer->excludeAttributesWMS ();
2872
2873
QgsAttributes featureAttributes = feat->attributes ();
2873
2874
const QgsFields* fields = feat->fields ();
2874
2875
for ( int i = 0 ; i < fields->count (); ++i )
2875
2876
{
2876
2877
QString attributeName = fields->at ( i ).name ();
2878
+ // skip attribute if it is explicitly excluded from WMS publication
2879
+ if ( excludedAttributes.contains ( attributeName ) )
2880
+ {
2881
+ continue ;
2882
+ }
2877
2883
QDomElement fieldElem = doc.createElement ( " qgs:" + attributeName.replace ( QString ( " " ), QString ( " _" ) ) );
2878
2884
QString fieldTextString = featureAttributes[i].toString ();
2879
2885
if ( layer )
You can’t perform that action at this time.
0 commit comments