Some cleaning

This commit is contained in:
Blottiere Paul 2019-01-18 16:22:27 +00:00
parent 8db9ab1563
commit f841681c06
2 changed files with 3 additions and 4 deletions

View File

@ -239,7 +239,7 @@ QString QgsJsonExporter::exportFeatures( const QgsFeatureList &features ) const
QString layerName;
if ( mIncludeName )
layerName.append( QStringLiteral( "\n \"name\": \"%1\",\n" ).arg( mLayer->name() ) );
layerName = QStringLiteral( "\n \"name\": \"%1\",\n" ).arg( mLayer->name() );
return QStringLiteral( "{%1 \"type\": \"FeatureCollection\",\n \"features\":[\n%2\n]}" ).arg( layerName, featureJSON.join( QStringLiteral( ",\n" ) ) );
}

View File

@ -2281,8 +2281,7 @@ namespace QgsWms
QByteArray QgsRenderer::convertFeatureInfoToJson( const QList<QgsMapLayer *> &layers, const QDomDocument &doc ) const
{
QString json;
json.append( QStringLiteral( "{" ) );
json.append( QStringLiteral( "\"layers\":[" ) );
json.append( QStringLiteral( "{\n\"layers\":[" ) );
const bool withGeometry = ( QgsServerProjectUtils::wmsFeatureInfoAddWktGeometry( *mProject ) && mWmsParameters.withGeometry() );
@ -2318,7 +2317,7 @@ namespace QgsWms
for ( int j = 0; j < featuresNode.size(); ++j )
{
const QDomElement featureNode = featuresNode.at( j ).toElement();
const qint64 fid = featureNode.attribute( QStringLiteral( "id" ) ).toLongLong();
const QgsFeatureId fid = featureNode.attribute( QStringLiteral( "id" ) ).toLongLong();
const QgsFeature feature = vl->getFeature( fid );
features << feature;