Skip to content

Commit

Permalink
No data is only for HTML and TEXT format
Browse files Browse the repository at this point in the history
  • Loading branch information
pblottiere committed Sep 28, 2020
1 parent 053ae1e commit b63dc39
Showing 1 changed file with 13 additions and 3 deletions.
16 changes: 13 additions & 3 deletions src/server/services/wms/qgswmsrenderer.cpp
Expand Up @@ -1775,7 +1775,7 @@ namespace QgsWms
QDomElement attributeElement = infoDocument.createElement( QStringLiteral( "Attribute" ) );
attributeElement.setAttribute( QStringLiteral( "name" ), layer->bandName( it.key() ) );

QString value( QStringLiteral( "no data" ) );
QString value;
if ( ! it.value().isNull() )
{
value = QString::number( it.value().toDouble() );
Expand Down Expand Up @@ -2126,8 +2126,13 @@ namespace QgsWms
for ( int j = 0; j < attributeNodeList.size(); ++j )
{
QDomElement attributeElement = attributeNodeList.at( j ).toElement();
QString value = attributeElement.attribute( QStringLiteral( "value" ) );
if ( value.isEmpty() )
{
value = QStringLiteral( "no data" );
}
featureInfoString.append( "<TR><TH>" + attributeElement.attribute( QStringLiteral( "name" ) ) +
"</TH><TD>" + attributeElement.attribute( QStringLiteral( "value" ) ) + "</TD></TR>\n" );
"</TH><TD>" + value + "</TD></TR>\n" );
}
}

Expand Down Expand Up @@ -2184,8 +2189,13 @@ namespace QgsWms
for ( int j = 0; j < attributeNodeList.size(); ++j )
{
QDomElement attributeElement = attributeNodeList.at( j ).toElement();
QString value = attributeElement.attribute( QStringLiteral( "value" ) );
if ( value.isEmpty() )
{
value = QStringLiteral( "no data" );
}
featureInfoString.append( attributeElement.attribute( QStringLiteral( "name" ) ) + " = '" +
attributeElement.attribute( QStringLiteral( "value" ) ) + "'\n" );
value + "'\n" );
}
}

Expand Down

0 comments on commit b63dc39

Please sign in to comment.