<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Unable to fetch the Layer Names in ArcGIS JavaScript Maps SDK Questions</title>
    <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/unable-to-fetch-the-layer-names/m-p/405710#M37386</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I am trying to obtain the names of the individual layers in the MapService that I have hosted and populate it in the dijit.form.select. Now I have the mapservice url but is there some way I can obtain the layer names from them?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;What I am trying to say is, I have one dijit.form.select which has the MXD names that I have provided in the list form,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="plain" name="code"&gt;&amp;lt;select name="Mxds" data-dojo-type="dijit.form.Select" id="ddMxd" data-dojo-props="onChange:function(){populateLayers(this.get('value'));}"&amp;gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;option value=0&amp;gt;Soil&amp;lt;/option&amp;gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;option value=1 selected="selected"&amp;gt;Human Intervention&amp;lt;/option&amp;gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;option value=2&amp;gt;Climate&amp;lt;/option&amp;gt;
&amp;nbsp; &amp;lt;/select&amp;gt;&lt;/PRE&gt;&lt;DIV style="display:none;"&gt; &lt;/DIV&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;And On select change, I populate the other dijit.form.select like this,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="plain" name="code"&gt;var opts = [];
&amp;nbsp; for (var i = 0; i&amp;lt;ddArray[val].length; i++) {
&amp;nbsp;&amp;nbsp; opts.push({label: ddArray[val]&lt;I&gt;.substring(54,ddArray[val]&lt;I&gt;.length-12), value: ddArray[val]&lt;I&gt;});
&amp;nbsp; }
ddLyr = new dijit.form.Select({
&amp;nbsp;&amp;nbsp; name: "selectLyr",
&amp;nbsp;&amp;nbsp; options: opts
&amp;nbsp; }, dojo.byId('lyrs'));
&amp;nbsp; ddLyr.startup();
&amp;nbsp; dojo.connect(ddLyr, 'onChange', addLayer);
&amp;nbsp; }
&lt;/I&gt;&lt;/I&gt;&lt;/I&gt;&lt;/PRE&gt;&lt;DIV style="display:none;"&gt; &lt;/DIV&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Any Idea how I can achieve this? ddArray is an array which holds all the urls,&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 06 Nov 2012 16:31:22 GMT</pubDate>
    <dc:creator>SmaranHarihar</dc:creator>
    <dc:date>2012-11-06T16:31:22Z</dc:date>
    <item>
      <title>Unable to fetch the Layer Names</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/unable-to-fetch-the-layer-names/m-p/405710#M37386</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I am trying to obtain the names of the individual layers in the MapService that I have hosted and populate it in the dijit.form.select. Now I have the mapservice url but is there some way I can obtain the layer names from them?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;What I am trying to say is, I have one dijit.form.select which has the MXD names that I have provided in the list form,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="plain" name="code"&gt;&amp;lt;select name="Mxds" data-dojo-type="dijit.form.Select" id="ddMxd" data-dojo-props="onChange:function(){populateLayers(this.get('value'));}"&amp;gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;option value=0&amp;gt;Soil&amp;lt;/option&amp;gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;option value=1 selected="selected"&amp;gt;Human Intervention&amp;lt;/option&amp;gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;option value=2&amp;gt;Climate&amp;lt;/option&amp;gt;
&amp;nbsp; &amp;lt;/select&amp;gt;&lt;/PRE&gt;&lt;DIV style="display:none;"&gt; &lt;/DIV&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;And On select change, I populate the other dijit.form.select like this,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="plain" name="code"&gt;var opts = [];
&amp;nbsp; for (var i = 0; i&amp;lt;ddArray[val].length; i++) {
&amp;nbsp;&amp;nbsp; opts.push({label: ddArray[val]&lt;I&gt;.substring(54,ddArray[val]&lt;I&gt;.length-12), value: ddArray[val]&lt;I&gt;});
&amp;nbsp; }
ddLyr = new dijit.form.Select({
&amp;nbsp;&amp;nbsp; name: "selectLyr",
&amp;nbsp;&amp;nbsp; options: opts
&amp;nbsp; }, dojo.byId('lyrs'));
&amp;nbsp; ddLyr.startup();
&amp;nbsp; dojo.connect(ddLyr, 'onChange', addLayer);
&amp;nbsp; }
&lt;/I&gt;&lt;/I&gt;&lt;/I&gt;&lt;/PRE&gt;&lt;DIV style="display:none;"&gt; &lt;/DIV&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Any Idea how I can achieve this? ddArray is an array which holds all the urls,&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 06 Nov 2012 16:31:22 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/unable-to-fetch-the-layer-names/m-p/405710#M37386</guid>
      <dc:creator>SmaranHarihar</dc:creator>
      <dc:date>2012-11-06T16:31:22Z</dc:date>
    </item>
  </channel>
</rss>

