Skip to content
Permalink
Browse files
WMS server: Use ; as separator in case of multiple selection for valu…
…e relations
  • Loading branch information
mhugent committed May 21, 2014
1 parent c0a5697 commit 5f12661d348b9fb1f13e5d6c8a71a8dd8d2ee5ed
Showing with 1 addition and 27 deletions.
  1. +1 −27 src/mapserver/qgswmsserver.cpp
@@ -2887,42 +2887,16 @@ QString QgsWMSServer::replaceValueMapAndRelation( QgsVectorLayer* vl, int idx, c
{
QString valueString = attributeVal;
QStringList valueList = valueString.remove( QChar( '{' ) ).remove( QChar( '}' ) ).split( "," );
outputString += "{";
for ( int i = 0; i < valueList.size(); ++i )
{
if ( i > 0 )
{
outputString += ",";
outputString += ";";
}
outputString += relationValue( valueList.at( i ), layer, vrdata.mKey, vrdata.mValue );
}
outputString += "}";
}
else
{
outputString = relationValue( attributeVal, layer, vrdata.mKey, vrdata.mValue );
}

return outputString;

/*
int keyId = layer->fieldNameIndex( vrdata.mKey );
int valueId = layer->fieldNameIndex( vrdata.mValue );
if ( keyId == -1 || valueId == -1 )
{
return attributeVal;
}
QgsFeatureIterator fIt = layer->getFeatures( QgsFeatureRequest().setFlags( QgsFeatureRequest::NoGeometry ).setSubsetOfAttributes( QgsAttributeList() << keyId << valueId ) );
QgsFeature f;
while ( fIt.nextFeature( f ) )
{
if ( f.attribute( vrdata.mKey ).toString() == attributeVal )
{
return f.attribute( vrdata.mValue ).toString();
}
}*/

}
return attributeVal;
}

0 comments on commit 5f12661

Please sign in to comment.