Hello,
I am attempting to link one feature to another, and am having no luck. For context, I am attempting to link the URLs to the text contained in the Incorporation_Citation feature, which only appears for two of my map points. The final text and citation should appear on the final line of the pop-up.
I have attempted this with two valid scripts:
if(IsEmpty($feature.Incorporation_Citation))
{return null}
else if (name == 'Alaska') {return <a target="_blank" rel="noopener noreferrer" href=https://tile.loc.gov/storage-services/service/ll/cfr/cf/r1/95/90/03/-T/3C/I/cfr1959003-T3CI/cfr1959003-T3CI.pdf#page=2>$feature.Incorporation_Citation</a>}
else if (name == 'New Mexico') {return <a target="_blank" rel="noopener noreferrer" href=https://tile.loc.gov/storage-services/service/ll/llsl/llsl-c62/llsl-c62.pdf#page=2005>$feature.Incorporation_Citation</a>}
And:
var state = $feature.Name
var inc_citation = $feature.Incorporation_Citation
var url =
WHEN(
$feature.Name == 'Alaska', 'https://tile.loc.gov/storage-services/service/ll/cfr/cf/r1/95/90/03/-T/3C/I/cfr1959003-T3CI/cfr1959003-T3CI.pdf#page=2',
$feature.Name == 'New Mexico', 'https://tile.loc.gov/storage-services/service/ll/llsl/llsl-c62/llsl-c62.pdf#page=2005'
)
When($feature.Name == 'Alaska', 'https://tile.loc.gov/storage-services/service/ll/cfr/cf/r1/95/90/03/-T/3C/I/cfr1959003-T3CI/cfr1959003-T3CI.pdf#page=2','')
return {
type : 'text',
text : `<p><a href=${url} target="_blank">${inc_citation}</a></p>`
}
When($feature.Name == 'New Mexico', 'https://tile.loc.gov/storage-services/service/ll/llsl/llsl-c62/llsl-c62.pdf#page=2005','')
return {
type : 'text',
text : `<p><a href=${url} target="_blank">${inc_citation}</a></p>`
}
When I attempt to include it, the Arcade expression does not return the linked text. Embedding either of these scripts directly into another expression also does not work.
I have also tried to create this as an Arcade expression, rather than an attribute expression, as another content portion of the pop-up itself, which also does not work.
I'm fairly new to working with Arcade, so any base scripts or direction towards which specific functions I should use would be incredibly helpful. Thank you!