Select to view content in your preferred language

Custom symbol referenced as part of a composite label expression

389
3
03-11-2024 12:07 PM
Labels (1)
IanLadd_Tourmaline
New Contributor III

Hello,

When creating a label expression in ArcGIS Pro, I want to have my custom symbol, next to my label that has a background, and the symbol changes depending on the value in the data. For example, the light grey and red symbol would change depending on the type of feature it is.Screenshot 2024-03-11 130517.png

Essentially what I want to do is create the label in the following link, but instead of referencing a font symbol, I want to reference a list of symbols from a custom style that will be used depending on the value in the data. 

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

Also if someone knows how to make a composite label like that as well, that info would be greatly helpful.

Thank you,

 

Ian

0 Kudos
3 Replies
RonaldHaug
Occasional Contributor II

Hi Ian,

First you would have to 1) create unique symbology, and then 2) create unique labels.

1) So you have to pick an attribute and create unique symbols.  Go here to learn.

https://pro.arcgis.com/en/pro-app/3.1/help/mapping/layer-properties/unique-value.htm

Then you have to add label classes from symbology layers. Go here to learn about this. It is really cool.

https://pro.arcgis.com/en/pro-app/latest/help/mapping/text/label-classes.htm

You can save your unique symbols as a style in your very own style library or just save them to your favorites.

Let us know how you did.

0 Kudos
IanLadd_Tourmaline
New Contributor III

Hi Ronald, 

Yes that is an option but is very time consuming and often breaks as the label gets moved away from the symbol. I should have added that the image is the complete label and would show where the point is via a leader line like the following image. I ended up making label classes that way, but ideally what I would like is just to add a label expression in Arcade similar to the post that I linked to, where it sources the icon from a font symbol (I'd like to source an actual symbol) and I don't have to create 30 label classes. Which if I ever decide to change the color of the text background, I have to go in and change all 30. Do you know what I would code in there to reference a particular symbol from my custom style?

This is the code from the arcade expression and I replaced where I would need to reference my symbol:


function StormSymbol(code) { if (code == 'Pipe') return '<WHAT WOULD I WRITE HERE TO REFERENCE A SYMBOL FROM MY MASTER STYLE">×</FNT>' if (code == 'HU') return '<FNT name = "ESRI METEOROLOGICAL 01">Ø</FNT>' if (code == 'TD') return '<FNT name = "ESRI METEOROLOGICAL 01">Ö</FNT>' } `<PART position="top">${$feature.STORMNAME}</PART><FNT size='25'><PART position="left">${StormSymbol($feature.STORMTYPE)}</PART><PART position="middle">CAT ${$feature.SS}</PART><PART position="right">${$feature.INTENSITY}</PART></FNT><PART position="bottom">CATEGORY</PART><PART position="bottomleft">STORM TYPE</PART><PART position="bottomright">INTENSITY</PART>`

IanLadd_Tourmaline_0-1710777562521.png

 

0 Kudos
RonaldHaug
Occasional Contributor II

Hi Ian,

You're very welcome. I'm glad I got you this far.  You could save the symbols and labels as an empty layer package.

I don't do a lot of coding. I would like to pass you off to one of my pals here on esri community who do. I recommend you send a flare up on the developers page.

Best wishes for your continuing progress!

0 Kudos