Skip to content
Permalink
Browse files

No data is only for HTML and TEXT format

  • Loading branch information
pblottiere committed Sep 28, 2020
1 parent 053ae1e commit b63dc39d27ffb05f900f2a7230383f934dd5ba2e
Showing with 13 additions and 3 deletions.
  1. +13 −3 src/server/services/wms/qgswmsrenderer.cpp
@@ -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() );
@@ -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" );
}
}

@@ -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" );
}
}

0 comments on commit b63dc39

Please sign in to comment.
You can’t perform that action at this time.