I created something similar using this sample - http://help.arcgis.com/en/webapi/javascript/arcgis/help/jssamples_start.htm#jssamples/map_dynamiclayerlist.htmlI also found a variation of this sample that was helpful - http://maps.roktech.net/demo/toc_example/index.htmhope 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); } }
Angemeldete Mitglieder können Beiträge verfassen, Updates folgen und mehr. Neu hier? Registriere ein kostenloses Konto.
Find useful guides, FAQs, and documents to help you navigate and make the most of Esri Community.