Customizing the build layer list function

Discussion created by spareeth on May 2, 2012
Hi group

We have created map services for all our datasets using arcgis server 10. There are number of services based on the way the data sets are arranged. For example we have a map service named SriLanka for all the layers of SL, another map service named 'India' for all the layers representing India and so on. This arrangement is easy for us to organize the data and host it whenever new data comes for a specific geographic location.

We are trying to develop a data portal with extensive search facility for the users. We are including a spatial search (web mapping component) to this portal and using Arcgis JS API for the development. All our above mentioned datasets has a  layer metadata (with general info like title, bbox, mapservice url, id etc) and on searching a location it will list all the datasets which is relevant to that bbox in a new popup. This query is completely based on this metadata table and resulted popup will have individual layers from multiple services. Now the user can select the layers from this result and view it in the map.

We are little stuck at the last part basically to populate a layer list based on user selection. User may select one or two layers from the same map service, or multiple layers from multiple services etc. To generate a dynamic layer list with check box from a single service with all the layer in that service is available in the samples. But how to create a dynamic layer list with check box, based on the user selection, that means selecting only some layers from a single service, or some layers (not all) from multiple services.

Can anyone give hints on how to proceed? We have started exploring in the direction of using json to fill id's in image parameters but not completely successful.

Any code samples you can guide us to?

Many thanks for all the help you can provide.