Identifier for different mapserver

686
4
12-26-2017 02:58 AM
VeenaHosur
New Contributor II

HI,

I have layers list from different map servers.How to do identifier task for those layers  

Tags (1)
0 Kudos
4 Replies
RobertScheitlin__GISP
MVP Emeritus

Veena,

     The IdentifyTask does not care if you have multiple different map services in your map. Here is a sample for the JS API samples:

Display identify results in popup | ArcGIS API for JavaScript 3.23 

VeenaHosur
New Contributor II

in identifier task they passed URL,that URL i have different url around five url's i have.How to do identifiers for those url.

0 Kudos
RobertScheitlin__GISP
MVP Emeritus

Veena,

   You will have to use a separate IdentifyTask for each url. The way to handle this is to loop through all the layers in the map and create a array of mapservice urls and create a IdentifyTask for  each add each of those IdentifyTasks to a dojo/promise/all that way you do not work with the results until all your IdentifyTasks are complete. There is several threads about this and if you want actual code you can look at then you can look at my Identify Widget for the Web App Builder:

https://community.esri.com/docs/DOC-3250-identify-widget-version-23-02172017 

PanagiotisPapadopoulos
Esri Regular Contributor

Try to use a webmap in order to construct the map contains. Web map by ID | ArcGIS API for JavaScript 3.23 

Through the webmap is very easy to setup the identify popup for each layer using the arcgis online viewer.

Finally you can use this webmap (JSON) into your code Web map using JSON | ArcGIS API for JavaScript 3.23 .

Also using the webmap you have all the other benefits like set the symbology, enable labels for Feature services e.t.c.