Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Some cleaning
  • Loading branch information
pblottiere committed Jan 28, 2019
1 parent 8db9ab1 commit f841681
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 4 deletions.
2 changes: 1 addition & 1 deletion src/core/qgsjsonutils.cpp
Expand Up @@ -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" ) ) );
}
Expand Down
5 changes: 2 additions & 3 deletions src/server/services/wms/qgswmsrenderer.cpp
Expand Up @@ -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() );

Expand Down Expand Up @@ -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;

Expand Down

0 comments on commit f841681

Please sign in to comment.