Accessing two layers from different services

Discussion created by spareeth on Dec 5, 2011
Latest reply on Dec 5, 2011 by DSwingley-esristaff
Hi all

Pretty new to AGS JS api, and we are stuck at a simple problem. Our search is based on extents and sql query and need to fetch the search results as layers from different services. As we have already designed and established our data infrastructure and have many services serving all the layers.

My question is;

Is it possible to get 2 layers from 2 different services. Each service may have more than one layers and we are interested in getting selected ones.

How to do this using JS api? We have seen similar examples, but they are for getting selected layers from a single service.

Any tips would be really helpful.