I have an ArcGIS Online WebMap with 5 web services on it and I would like to run an IdentifyTask so that I can obtain a list of all the features that fall under a clicked point. I know that popups provide this same functionality of being able to identify all the features under a clicked point, but I am looking to present the data in a custom sidebar rather than a popup, so I figured using the IdentifyTask is the way to go.
A similar question has been asked and answered (by Kelly Hutchins) on how this might be done with the 3.x API (here), but I am trying to figure out how to do it with the 4.x API.
The part I am stuck on is what to pass in to the IdentifyTask in place of a service URL, as shown in the Esri example:
<SPAN class="comment token">// Create identify task for the specified map service</SPAN>
identifyTask <SPAN class="operator token">=</SPAN> <SPAN class="keyword token">new</SPAN> <SPAN class="token class-name">IdentifyTask</SPAN><SPAN class="punctuation token">(</SPAN>mapServiceURL<SPAN class="punctuation token">)</SPAN><SPAN class="punctuation token">;</SPAN><SPAN class="line-numbers-rows"><SPAN></SPAN><SPAN></SPAN></SPAN>
Can the IdentifyTask be used with an AGOL WebMap, and if so, what needs to be done to accomplish that?
Thanks.