Skip to content

Commit

Permalink
Fix bad backport
Browse files Browse the repository at this point in the history
  • Loading branch information
elpaso authored and nyalldawson committed Jan 28, 2021
1 parent b5e410f commit 6e5dfe9
Showing 1 changed file with 15 additions and 2 deletions.
17 changes: 15 additions & 2 deletions src/server/services/wms/qgswmsrenderer.cpp
Expand Up @@ -2249,9 +2249,22 @@ namespace QgsWms

for ( int j = 0; j < featuresNode.size(); ++j )
{

const QDomElement featureNode = featuresNode.at( j ).toElement();
const QgsFeatureId fid = featureNode.attribute( QStringLiteral( "id" ) ).toLongLong();
QgsFeature feature = QgsFeature( vl->getFeature( fid ) );
const QString fid = featureNode.attribute( QStringLiteral( "id" ) );
QgsFeature feature;
const QString expression { QgsServerFeatureId::getExpressionFromServerFid( fid, static_cast<QgsVectorDataProvider *>( layer->dataProvider() ) ) };
if ( expression.isEmpty() )
{
feature = vl->getFeature( fid.toLongLong() );
}
else
{
QgsFeatureRequest request { QgsExpression( expression )};
request.setFlags( QgsFeatureRequest::Flag::NoGeometry );
vl->getFeatures( request ).nextFeature( feature );
}


fidMap.insert( feature.id(), fid );

Expand Down

0 comments on commit 6e5dfe9

Please sign in to comment.