I have a street map with a Street Index listing street names in alphabetical order and showing which section(s) those street are listed in. I am trying to use the Dynamic Text - Table Attribute to create the Street Index from an Excel spreadsheet.
I am using an Arcade expression to count the number of characters in the street name and the section(s) to then determine how many leader dots to place in between the street name and the section. I've decided on a total character length of 30 as this should hold the longest street name and the longest section(s) and still allow a few leader dots in between the two.
This is a small sample of my Excel spreadsheet:
Column A contains the street names and Column B contains the section(s) that particular street is found in on the map.
Looking at my Text Element, from the Insert Table Attribute I am using an Arcade expression. I want the Arcade expression to add a blank row between the numeric street names and another blank row between the street names that start with A and another blank row between the street names that start with B, etc. to the end of the alphabet. I am using the Arcade expression to count the total number of characters found in the street name and section(s) to determine how many leader dots to place in between the two words.
This is what my Arcade expression looks like:
if ($feature.Section == null)
{
return TextFormatting.NewLine + $feature.StreetNames + TextFormatting.NewLine
}
var a = $feature.StreetNames + $feature.Section
var b = Count(a)
var c = 30 - b
var d = c/2
var e = c%2
if (e == 0) {d = d +1}
var dotString = ""
for (var i=0; i<d; i++)
{dotString = dotString + ". "}
return $feature.StreetNames + " " + dotString + $feature.Section + TextFormatting.NewLine
(Note: I'm not good with Arcade yet, so had to have a colleague help me with the above expression)
Because I have calculated the number of leader dots to have each line a total of 30 characters, I was expecting that my results would display as even straight columns ending at the same position on the right hand side, but that is not the results I'm getting. I have tried setting my Text symbol - Appearance - Position - Horizontal alignment as "Left", "Center", "Right" and "Justify" and none of them return even columns.
I have tried using several monospaced fonts (Lucida Sans Typewriter, Simsun, Courier New) and this doesn't help either. This is the results I am getting. The right hand side of the columns is uneven.
I used to make this map in ArcMap using 8 individual Text Boxes where I manually typed the street name, the leader dots and the section, hit the hard return after each line and used the full justify position. The result was very neat looking but hard to maintain whenever new streets were built. If the new street started with the letter "C" it would be added in the second text box in alphabetical order and then the last street from each text box to the right of it would have to be manually moved to the top of the next text box. I'm trying to transfer this map to ArcGIS Pro and take advantage of its newer functionality but can't get results to be even on both sides of each column. This is what the street index looks like in ArcMap using individual text boxes:
Any suggestions/ideas would be appreciated.