Hello, all. I've seen similar questions asked here, but none quite get at what I'm looking for. We maintain a bunch of plan area polygons that store a hyperlink to scanned construction plans. Currently, we access those plans just from the popup of the plan area. In any given area, for any given asset (water mains, for example), there may be multiple plans that are relevant. Currently, we have to cycle through all the plan popups to find the one we want, but it's been requested that I make it so we can click on an individual asset and see all the relevant plans.
I'm thinking something with Arcade would be the best bet at a solution that is performant, maintainable, and doesn't balloon our database size. However, I can only seem to get about 2/3 of the way there.
I have an expression that can return each link on it's own line, but it's hard to read and it doesn't automatically format as a link:
//get names and hyperlinks of intersecting plan features
var plans = Intersects($feature, FeatureSetByName($datastore,"Plan Area", ["PlanName","Hyperlink"]));
//create string to store hyperlinks and add links with lines in between
var linkList = '';
for (var p in plans){
var linklist = linklist + p.Hyperlink + TextFormatting.Newline;
}
return linklist;
Which returns:
https://website.com/link1.pdf
https://website.com/link2.pdf
https://website.com/link3.pdf
Since it's all in a single field, none of the URL text acts as a link. What I'd like to do is have all the plan names listed and formatted as hyperlinks to the corresponding plan document:
Plan 1->https://website.com/link1.pdf
Plan 2->https://website.com/link2.pdf
Plan 3->https://website.com/link3.pdf
Have I reached the limits of the popup's capabilities, or is there a key step I missed? Alternatively, is there a way to pass this info to Javascript API to build a popup in a map built that way?