AnsweredAssumed Answered

Using the IdentifyTask with a WebMap from AGOL with the 4.x API

Question asked by TomFlahive on May 4, 2017
Latest reply on May 4, 2017 by TomFlahive

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:

// Create identify task for the specified map service
identifyTask = new IdentifyTask(mapServiceURL);


Can the IdentifyTask be used with an AGOL WebMap, and if so, what needs to be done to accomplish that?