mirror of
https://github.com/qgis/QGIS.git
synced 2025-12-30 00:29:39 -05:00
qgsvectorlayer: Expose 3D extent in htmlMetadata
Try to display extent 3D by default. If empty (probably because the data is 2D), fallback to the 2D version.
This commit is contained in:
parent
9f055dd565
commit
6372a3a456
@ -5841,7 +5841,10 @@ QString QgsVectorLayer::htmlMetadata() const
|
||||
}
|
||||
|
||||
// Extent
|
||||
myMetadata += QStringLiteral( "<tr><td class=\"highlight\">" ) + tr( "Extent" ) + QStringLiteral( "</td><td>" ) + extent().toString() + QStringLiteral( "</td></tr>\n" );
|
||||
// Try to display extent 3D by default. If empty (probably because the data is 2D), fallback to the 2D version
|
||||
const QgsBox3D extentBox3D = extent3D();
|
||||
const QString extentAsStr = !extentBox3D.isEmpty() ? extentBox3D.toString() : extent().toString();
|
||||
myMetadata += QStringLiteral( "<tr><td class=\"highlight\">" ) + tr( "Extent" ) + QStringLiteral( "</td><td>" ) + extentAsStr + QStringLiteral( "</td></tr>\n" );
|
||||
}
|
||||
|
||||
// feature count
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user