1

I have seen this question and have tried the code suggested: Adapting ESRI ArcGIS API for JavaScript Feature Layer With Selection sample for use in Configurable Map Viewer (CMV)

But I have been unable to get it to work. I also want to change the result from the sum to the average.

Here is my error report from chrome development tools My error report

1 Answer 1

2

For your first issue: it appears that the template file for your widget is missing, inaccessible or corrupt. Based on the code posted in the linked example, the template file is './Select/templates/Select.html'. Check that file to ensure it is valid.

For your second issue: to do a simple average, you would take the sum calculated in the example code this.productionSum and divide by the number of features event.features.length. Something like:

this.productionAVG = (this.productionSum / event.features.length)

Be sure to handle a possible divide by zero error in the cases where no features are returned by the selection.

1
  • tmcgee answered the second half of this question in here
    – Fiter
    Commented Jan 15, 2015 at 16:35

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.