liquidua

Show labels for graphics

Discussion created by liquidua on May 31, 2019
Latest reply on Jun 10, 2019 by LDanzinger-esristaff

Hello,

I want to show individual labels for each object on my map. For example, I have map with many moving planes (use PictureMarkerSymbol), and I want to show their flight numbers.

I've tried to use same methods, as in this example, but it didn’t work.

https://developers.arcgis.com/qt/latest/cpp/sample-code/sample-qt-showlabelsonlayers.htm 

 

const QString labelJson(QStringLiteral(
"{\"labelExpressionInfo\":{\"expression\":\"# number\"},\"labelPlacement\":\"esriServerPointLabelPlacementAboveRight\",\"symbol\": {\"color\":[0,0,255,255],\"font\": {\"size\":15}"));
LabelDefinition* labelDef = LabelDefinition::fromJson(labelJson, this);

m_graphicsOverlay->labelDefinitions()->append(labelDef);
m_graphicsOverlay->setLabelsEnabled(true);

 

Is possible to use labelDefinitions for my task? How I need to write "expression":"# number" - to show individual  labels for each graphics?

 

Regards,

Alex

Outcomes