Skip to content
Permalink
Browse files

getProjectSettings response: return 'maptip' instead of tooltip templ…

…ate as

displayField layer attribute
  • Loading branch information
jef-n committed Nov 22, 2014
1 parent ebfa600 commit 269b6264a7ab46688fa112433f94bc54836a530e
Showing with 3 additions and 2 deletions.
  1. +3 −2 src/mapserver/qgsserverprojectparser.cpp
@@ -625,7 +625,8 @@ void QgsServerProjectParser::addLayerProjectSettings( QDomElement& layerElem, QD
{
QgsVectorLayer* vLayer = static_cast<QgsVectorLayer*>( currentLayer );
const QSet<QString>& excludedAttributes = vLayer->excludeAttributesWMS();
QString displayField = vLayer->displayField();
int displayFieldIdx = vLayer->fieldNameIndex( vLayer->displayField() );
QString displayField = displayFieldIdx < 0 ? "maptip" : vLayer->displayField();

//attributes
QDomElement attributesElem = doc.createElement( "Attributes" );
@@ -638,7 +639,7 @@ void QgsServerProjectParser::addLayerProjectSettings( QDomElement& layerElem, QD
continue;
}
// field alias in case of displayField
if ( field.name() == displayField )
if ( idx == displayFieldIdx )
{
displayField = vLayer->attributeDisplayName( idx );
}

0 comments on commit 269b626

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