AnsweredAssumed Answered

Dynamically create layer list

Question asked by serenebalance on May 18, 2011
Latest reply on Mar 11, 2015 by Mr_Kirkwood
I am new to JavaScript.  I am using the provided Base Map: AzureTwitter.  I would like to add in the code for dynamically creating the layer lists.  I found the thread link below with the coding to add in.  However I am not sure how to incorporate this code into my existing index.html and layout.js, as the code in the link below is all shown in one file.  

http://help.arcgis.com/en/webapi/javascript/arcgis/help/jssamples_start.htm#jssamples/map_dynamiclayerlist.html

My questions:
How do I add the code. 
Where do I put in the link to my dynamic layer list

Below is the  layer code.. I know I change the address.. but do I put in my unique ArcGIS Map ID in that line or a http address that is provided to me in my map settings.

        layer = new esri.layers.ArcGISDynamicMapServiceLayer("http://sampleserver1.arcgisonline.com/ArcGIS/rest/services/Specialty/ESRI_StatesCitiesRivers_USA/MapServer");

Is there additional code I need to add to my javascript layout to call the layers into my index file? 

Thank you for your help.  I have no prior experience with Java.. only using CSS coding, html, and ArcView Software, but no online experience.  I want to learn though.

Any recommendations for passing the learning curve?  I went through the readme.html but it helped only a little bit.

Thank you for your help
Meghan

Outcomes