[Qgis-developer] QGIS_server: add a maptip field at the getfeatureinfo response.

Andrea Peri aperi2007 at gmail.com
Fri Aug 8 06:32:35 PDT 2014


Hi,

I notice on some response text/html to a GetFeatureInfo,
on some layer qgis-server add an hardcoded field named "maptip".

Also I notice it is not always added but nly on some layer.

I found the code in the
qgswmsserver.cpp

....
      //add maptip attribute based on html/expression (in case there
is no maptip attribute)
      if ( layer->fieldNameIndex( layer->displayField() ) < 0 )
      {
        QString displayField = layer->displayField();
        if ( !displayField.isEmpty() )
        {
          QDomElement maptipElem = infoDocument.createElement( "Attribute" );
          maptipElem.setAttribute( "name", "maptip" );
          maptipElem.setAttribute( "value",
QgsExpression::replaceExpressionText( displayField, &feature, layer )
);
          featureElement.appendChild( maptipElem );
        }
      }

....

Why this adding hardcoded ?

I guess it could be a refuse of something other old code ? And so removable ?

Actually this is quite fastidiosus (embarassing) for us, because it is
a not corresponding fied to the real structure of the layer.

Thx,

-- 
-----------------
Andrea Peri
. . . . . . . . .
qwerty àèìòù
-----------------


More information about the Qgis-developer mailing list