I have published in my ArcGIS Server two layers: A polygon one and a point feature one. Points are contained in polygons.
I would like to know how to count the number of points belonging/contained to a polygon using ArcGIS Javascript API. So, the functionality would be, clicking in one of the polygons and then, present somewhere an integer (in an Infowindow or textbox in sidebar) saying "There are X points in this polygon".
Could you provide any ideas or examples?