Select to view content in your preferred language

Difficulties displaying JS function based on feature field calculations in HTML web page

384
0
06-21-2022 07:04 AM
MichaelGeorge1
Emerging Contributor

Hello,

I am looking to display a statistic that I derived from a JS function, called "Weighted RSR". This statistic is calculated by the following equation:

(Sum(SquareYards * AdjustedRSR) )   /    (Sum(SquareYards))

 

The values "SquareYards" and "AdjustedRSR" are both attribute fields within a feature layer that I am embedding within an HTML web page. 

My workflow is the following:

 

Created Statistic queries (calculating sum) for the SquareYards and AdjustedRSR feature layer fields

 

Stat_query.png

Created a function to calculate my desired Weighted RSR statistic that I am looking to display, and then I called that function within my JS file that contains my feature layer 

Weighted RSR function.png

Note: "Current Road Surface Rating" is the terminology I am using to signify my Weighted RSR value within my web app

 

Finally, referenced my JS file which contains my  statistic queries and Weighted RSR function

 

HTML page.png

 

When I test my project all I am able to see within my HTML page is my feature layer. I am unable to get the result of my WeightedRSR function to display on the HTML page. 

 

Does my approach for creating a function which calculates the WeightedRSR function make sense? And does anyone have any insights as to why I am unable to have my function result display on my HTML page and/or tips on how I can get the function result to appear?

 

Any tips/recommendations/comments would be greatly appreciated. 

 

 

0 Kudos
0 Replies