Select to view content in your preferred language

Labeling Dynamic Entities

538
4
01-17-2024 02:51 AM
Labels (1)
pinisolomon1
New Contributor

Hi,

I started working with the dynamic data source to steam data to my application as far as rendering symbols working with the dictionary renderer is great! I have an issue with labeling the symbols.

I want to create a label in which the first line displays an icon with the text label also the first line should have a different background from the other two lines below. Also, I want the background to have round corners...

is it possible to achieve?

Also when using the symbol dictionary one can add text symbols to it and label placement but I could not get to these keys from the runtime... is it possible?

0 Kudos
4 Replies
Amir-Sarrafzadeh-Arasi
Occasional Contributor

Dear pinisolomon1,

You can do almost anything with dictionary renderer.

could you please explain well what you want to do?

if you add some images can be helpful, because I did not get what do you mean of 'first line' .

Thank you

Amir Sarrafzadeh Arasi
0 Kudos
pinisolomon1
New Contributor

Hi Amir, thank you for responding. I meant that my label will have more than one line and I would like to format the first line differently. I'm attaching two examples. 

Please notice that I'm referring to the label and not the symbol of the entity, also the label displays icons and not only text.

Also, Is it possible to create the label in xaml?

Screenshot 2024-01-18 231510.png

Screenshot 2024-01-18 231400.png

  

0 Kudos
KerryRobinson
Esri Contributor

Hello,

Here are some ideas on how to achieve what you want to do regarding a custom dictionary renderer with background behind text, and labels included with text.

Placing icons and lines of text is feasible following the logic used in the Park Amenities example from the dictionary toolkit.

A background for text can be done with a background callout. You could achieve rounded ends by using negative top and bottom margins (to make the background polygon almost flat) and rely on a thick outline: 

b8d02fd1-3a3f-40be-ae1d-62060c20bcd0.png

The left icon in the callout can be placed on top of that.
The icon on the right has a placement that is dependent on the length of the text. The only way to do this would be to use a fixed-width font and make the text string available as a symbol attribute. You would then offset the icon depending on the number of characters.

Hope that helps! Let us know if it does. 

Kerry

Tags (1)
0 Kudos
Amir-Sarrafzadeh-Arasi
Occasional Contributor

Dear  pinisolomon1,

Sorry for the late reply,

I have attached a sample project which I have done in ArcGIS Pro.

Please select the feature layer and check the labeling tab.
I defined 3 different classes with different conditions.

You can dynamicly modify the symbol, label, text, position, color, size, rotation, .....

You should be able to see the below image in the project.

screen.png

Please follow the below links to understand better dynamic labeling.

 

https://pro.arcgis.com/en/pro-app/3.1/help/mapping/text/label-using-a-composite-callout.htm

https://pro.arcgis.com/en/pro-app/3.1/help/mapping/text/text-formatting-tags.htmhttps://pro.arcgis.c...

 

If you need more clarification please let me know.

 

Best of luck

Amir  

 

Amir Sarrafzadeh Arasi
0 Kudos