Displaying information from different Feature Layers

Discussion created by irngeotec on Oct 19, 2012
Latest reply on Oct 22, 2012 by irngeotec
Hi all,

I have in my ArcGIS Server 10.1 two layers published: one corresponds to a World map by country and the other to a layer containing some cities, represented by points.

What I would like to do is creating a ESRI Javascript API interface to view those (Feature) layers, so when the user clicks on a point, it appears a popup (or info in a side bar, does not mind) with the BOTH features associated to this city, namely: name of the city AND name of the country the city belongs to. But, if the user clicks on an area where there is not any city, only the name of the country should be displayed.

I know that it is a quite basic example, but I am not sure on how to tackle this problem: I see examples on retrieving information from a SINGLE layer, but not about how to distinguish between information required from different layers.

Please, can anyone provide some information/ideas/links to tutorials about that?

Thanks for your help!