I am creating simple election map, that visualize the result over the county by Some election races, which I listed them on accordion Panel. I tried to follow this example , to render the feature layer. I failed to Add the following
1- Add on Click Events on the Race Accordion header then render the map according. by replacing the field names in the Arcade Expression
(on console log I was able to get all the fields name)
2- instead of placing the arcade expression on the HTML file (script tag) How can I add it to my separated js file(script.js).
I do appreciate your help.
Attaching my code so far.
Yes correct , and I have console.log to get the field names.
the problem I don't have any luck passing the array to the arcade expression, so I can get feature render accordingly
console.log(selectedAccordion);
console.log(currentCandidates);
Hmm.. Not sure you can do that. You can use the code I provided earlier to write a new expression though.
that sound good for me, could you please rewrite your code you are referring to with the expression, then will try to finalize the rest.
Thank you for your help.
I can't help you that much but here is a start.
var s = document.createElement('script');
s.type = 'text/javascript';
var code = 'alert("hello world!");';
try {
s.appendChild(document.createTextNode(code));
document.body.appendChild(s);
} catch (e) {
s.text = code;
document.body.appendChild(s);
}
Thank you Robert,
Will work on that
hi,
still trying to figure out how to use your code to write new expression, without any luck.
Regards
Husham,
Sorry I have never done that before either so I don't have any more advice.
Thank you Robert, I am just not trying pushing you, just updating you
Thanks for all help.