This widget queries summary statistics for features within the current map view. This code was mostly adapted from ArcGIS Javascript API 3.17 sample code Query Statistics with SQL Expression.
Add the following code to the viewer.js file
queryStatistics: {
include: true,
id: 'querystat',
type: 'titlePane',
path: 'widgets/QueryStatistics',
title: 'Summary Statistics',
open: true,
position: 0,
options: 'config/statisticsConfig'
},
- Adapt code from API sample
- Change the query geometry from point buffer to current map extent
- Add function to allow user to select layer for statistics
- Allow user to have a choice between point buffer and current map extent?