File tree 1 file changed +18
-1
lines changed
1 file changed +18
-1
lines changed Original file line number Diff line number Diff line change @@ -2343,12 +2343,29 @@ namespace QgsWms
2343
2343
exporter.setIncludeLayerName ( true );
2344
2344
2345
2345
if ( i > 0 )
2346
- json.append ( " ," );
2346
+ json.append ( QStringLiteral ( " ," ) );
2347
2347
2348
2348
json.append ( exporter.exportFeatures ( features ) );
2349
2349
}
2350
2350
else // raster layer
2351
2351
{
2352
+ json.append ( QStringLiteral ( " {" ) );
2353
+ json.append ( QStringLiteral ( " \n \" name\" : \" %1\" ,\n " ).arg ( layer->name () ) );
2354
+
2355
+ const QDomNodeList attributesNode = layerElem.elementsByTagName ( QStringLiteral ( " Attribute" ) );
2356
+ for ( int j = 0 ; j < attributesNode.size (); ++j )
2357
+ {
2358
+ const QDomElement attrElmt = attributesNode.at ( j ).toElement ();
2359
+ const QString name = attrElmt.attribute ( QStringLiteral ( " name" ) );
2360
+ const QString value = attrElmt.attribute ( QStringLiteral ( " value" ) );
2361
+
2362
+ if ( j > 0 )
2363
+ json.append ( QStringLiteral ( " ,\n " ) );
2364
+
2365
+ json.append ( QStringLiteral ( " \" %1\" : \" %2\" " ).arg ( name, value ) );
2366
+ }
2367
+
2368
+ json.append ( QStringLiteral ( " \n }" ) );
2352
2369
}
2353
2370
}
2354
2371
You can’t perform that action at this time.
0 commit comments