Skip to content

Commit

Permalink
WMS server: Use ; as separator in case of multiple selection for valu…
Browse files Browse the repository at this point in the history
…e relations
  • Loading branch information
mhugent committed May 21, 2014
1 parent c0a5697 commit 5f12661
Showing 1 changed file with 1 addition and 27 deletions.
28 changes: 1 addition & 27 deletions src/mapserver/qgswmsserver.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down

0 comments on commit 5f12661

Please sign in to comment.