Below you will find some materials presented at our 2023 User Conference ArcGIS Pro: Advanced Map Labeling technical workshop.
This expression was used as an alternate expression of our abbreviation settings in our Institutes point layer.
var eduSearchTerms = ["SCHOOL", "ACADEMY", "COLLEGIATE", "COLLEGE", "UNIVERSITY"]
var relSearchTerms = ["CHURCH", "MOSQUE", "SYNAGOGUE", "MONASTRY", "TEMPLE", "TABERNACLE", "WORSHIP"]
for (var i in eduSearchTerms)
{
if(find(eduSearchTerms[i], upper($feature.Name2)) > -1)
return "Edu."
}
for (var i in relSearchTerms)
{
if(find(relSearchTerms[i], upper($feature.Name2)) > -1)
return "Rel."
}
return proper($feature.Name2)
See Esri technical support article.
These expressions use Upper(), Right() and Count() Arcade functions to extract the characters after "Co Rd " or "State Hwy " in the FULLNAME field:
Upper(Right($feature.FULLNAME, Count($feature.FULLNAME) - 6))
Right($feature.FULLNAME, Count($feature.FULLNAME) - 10)
This expression takes into account any US Highways with banners in their names and places the banner above the number with a smaller font size.
Examples include "US Hwy 45 Alt" and "US Hwy 151 Bus"
In general terms, here is what the script does:
var shieldValue = Right($feature.FULLNAME, Count($feature.FULLNAME) - 7);
var shieldBanner = "";
var shieldNumber = shieldValue;
if(Find(" ", shieldNumber) > 0) {
shieldBanner = Split(shieldNumber, " ")[1];
shieldNumber = Split(shieldNumber, " ")[0];
return "<LIN leading='-4' leading_type = 'extra'>" + "<FNT size='8'>" + Upper(shieldBanner) +
"</FNT>" + TextFormatting.NewLine + shieldNumber + "</LIN>";
} else {
return shieldNumber;
}
Superscript 2 in the Km squared label:
$feature.ALAND_KM2 + " km<SUP>2</SUP>"
State labels with average commute times and change in average commute time since 2010:
var arrowStyle = "▲"; //Default all arrows to show an increase
if($feature.CommuteChange2010_2021 < 0) {
//Change to decrease arrow if the change in commute time decreased from 2010 to 2021.
arrowStyle = "▼";
}
//Configure values for the CLR (color) tag based on the size of increase or decrease in commute time.
var arrowColor = "red='253' green='174' blue='97'"; // small increase
if($feature.CommuteChange2010_2021 > 1) {
arrowColor = "red='215' green='25' blue='28'"; // large increase
}
if($feature.CommuteChange2010_2021 < 0) {
arrowColor = "red='171' green='217' blue='233'"; // small decrease
}
if($feature.CommuteChange2010_2021 < -1) {
arrowColor = "red='44' green='123' blue='182'"; // large decrease
}
//Use text formatting tags to:
// 1. Define the PARTs used in the Composite callout symbol grid.
// 2. Adjust font size of the state label with FNT tag.
// 3. Format numeric attributes using the Text function with a string pattern.
// 4. Set the arrow's color by inserting the parameters of the CLR tag set in the arrowColor above.
// 5. Put the commute time change value in italics with the ITA tag.
"<PART position='middle'>" +
"<FNT size='16'>" + $feature.STUSPS + "</FNT></PART>" +
"<PART position='right'>" +
Text($feature.MeanCommute2021, "#.#") + " min" + TextFormatting.NewLine +
"<CLR " + arrowColor + ">" + arrowStyle + "</CLR>" +
"<ITA>" + Text($feature.CommuteChange2010_2021, "#.#") + " min" + "</ITA></PART>"
Help article: Label with the Maplex Label Engine
Quick-start Tutorial: Label your map
Abbreviation Dictionary for commonly used street suffixes: Technical support article
Excellent resources - added industry tags for ease of access.