Skip to content

Commit

Permalink
getProjectSettings response: return 'maptip' instead of tooltip templ…
Browse files Browse the repository at this point in the history
…ate as

displayField layer attribute
  • Loading branch information
jef-n committed Nov 22, 2014
1 parent d36597a commit 50d2a74
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/mapserver/qgsserverprojectparser.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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" );
Expand All @@ -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 );
}
Expand Down

0 comments on commit 50d2a74

Please sign in to comment.