Solved! Go to Solution.
I created something similar using this sample - http://help.arcgis.com/en/webapi/javascript/arcgis/help/jssamples_start.htm#jssamples/map_dynamiclay...
I also found a variation of this sample that was helpful - http://maps.roktech.net/demo/toc_example/index.htm
hope that helps
for (var i=0; i<ddMapServ.length; i++) { var url = ddMapServ; var requestHandle = esri.request({ "url": url, "content": { "f": "json" }, "callbackParamName": "callback" }) requestHandle.then(requestSucceeded, requestFailed); }
function requestSucceeded(response, io) { if (response.hasOwnProperty("layers") ) { var lyr=[]; dojo.map(response.layers, function(f) { lyr.push(f.name); }); ddLyrName.push(lyr); } }
I created something similar using this sample - http://help.arcgis.com/en/webapi/javascript/arcgis/help/jssamples_start.htm#jssamples/map_dynamiclay...
I also found a variation of this sample that was helpful - http://maps.roktech.net/demo/toc_example/index.htm
hope that helps
for (var i=0; i<ddMapServ.length; i++) { var url = ddMapServ; var requestHandle = esri.request({ "url": url, "content": { "f": "json" }, "callbackParamName": "callback" }) requestHandle.then(requestSucceeded, requestFailed); }
function requestSucceeded(response, io) { if (response.hasOwnProperty("layers") ) { var lyr=[]; dojo.map(response.layers, function(f) { lyr.push(f.name); }); ddLyrName.push(lyr); } }