<?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 Re: Loading FeatureLayer with Treeview.OnClick in ArcGIS JavaScript Maps SDK Questions</title>
    <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/loading-featurelayer-with-treeview-onclick/m-p/184219#M17118</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Change the name of your FeatureLayer variable to see if that makes any difference. It could be getting confused with the variable name assigned to the module "&lt;SPAN class="str"&gt;esri/layers/FeatureLayer"&lt;/SPAN&gt;&lt;SPAN class="pun"&gt;,&lt;/SPAN&gt;&lt;SPAN class="pln"&gt; &lt;/SPAN&gt;&lt;SPAN class="kwd"&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class="pln"&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&amp;nbsp; featureLayer = new FeatureLayer(item.endpointurl,
&amp;nbsp;&amp;nbsp;&amp;nbsp; {
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; mode: FeatureLayer.MODE_ONDEMAND,
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; infoTemplate: infoTemplate,
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; outFields: ["*"]
&amp;nbsp;&amp;nbsp;&amp;nbsp; });

&amp;nbsp; featureLayer.setSelectionSymbol(fieldsSelectionSymbol);
&amp;nbsp; map.addLayer(featureLayer);&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Sat, 11 Dec 2021 09:21:40 GMT</pubDate>
    <dc:creator>KenBuja</dc:creator>
    <dc:date>2021-12-11T09:21:40Z</dc:date>
    <item>
      <title>Loading FeatureLayer with Treeview.OnClick</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/loading-featurelayer-with-treeview-onclick/m-p/184218#M17117</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Friends&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I want to create and display a single FeatureLayer from a different endpoint each time a tree node is clicked on.&lt;/P&gt;&lt;P&gt;The FeatureLayer should include symbology.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I pass in the Item.url with onClick and it works on the first pass.&lt;/P&gt;&lt;P&gt;The next .onClick is a different item.url and it bombs because it cannot create a new FeatureLayer.&lt;/P&gt;&lt;P class="subLogRow focusRow errorTitle"&gt;&lt;SPAN class="errorMessage"&gt;TypeError: FeatureLayer is not a constructor&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Suggestion on how to structure this.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Keith&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 28 Jan 2015 20:53:50 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/loading-featurelayer-with-treeview-onclick/m-p/184218#M17117</guid>
      <dc:creator>KeithAnderson</dc:creator>
      <dc:date>2015-01-28T20:53:50Z</dc:date>
    </item>
    <item>
      <title>Re: Loading FeatureLayer with Treeview.OnClick</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/loading-featurelayer-with-treeview-onclick/m-p/184219#M17118</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Change the name of your FeatureLayer variable to see if that makes any difference. It could be getting confused with the variable name assigned to the module "&lt;SPAN class="str"&gt;esri/layers/FeatureLayer"&lt;/SPAN&gt;&lt;SPAN class="pun"&gt;,&lt;/SPAN&gt;&lt;SPAN class="pln"&gt; &lt;/SPAN&gt;&lt;SPAN class="kwd"&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class="pln"&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&amp;nbsp; featureLayer = new FeatureLayer(item.endpointurl,
&amp;nbsp;&amp;nbsp;&amp;nbsp; {
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; mode: FeatureLayer.MODE_ONDEMAND,
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; infoTemplate: infoTemplate,
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; outFields: ["*"]
&amp;nbsp;&amp;nbsp;&amp;nbsp; });

&amp;nbsp; featureLayer.setSelectionSymbol(fieldsSelectionSymbol);
&amp;nbsp; map.addLayer(featureLayer);&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Dec 2021 09:21:40 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/loading-featurelayer-with-treeview-onclick/m-p/184219#M17118</guid>
      <dc:creator>KenBuja</dc:creator>
      <dc:date>2021-12-11T09:21:40Z</dc:date>
    </item>
    <item>
      <title>Re: Loading FeatureLayer with Treeview.OnClick</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/loading-featurelayer-with-treeview-onclick/m-p/184220#M17119</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thank you Ken!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Don’t I feel like a dope.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I was thinking this would destroy the previous FeatureLayer and display only the new one.&lt;/P&gt;&lt;P&gt;Now I have two FeatureLayers displaying.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If I put an id:  on it would that overwrite it?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Suggestions?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks again.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;K&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 28 Jan 2015 21:22:01 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/loading-featurelayer-with-treeview-onclick/m-p/184220#M17119</guid>
      <dc:creator>KeithAnderson</dc:creator>
      <dc:date>2015-01-28T21:22:01Z</dc:date>
    </item>
    <item>
      <title>Re: Loading FeatureLayer with Treeview.OnClick</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/loading-featurelayer-with-treeview-onclick/m-p/184221#M17120</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;If you only want to show one layer at a time, then you could simply remove the old one "map.removeLayer(featureLayer)" and add in the new one. You'll get an error if you put in the same id for two different items.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 28 Jan 2015 21:34:42 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/loading-featurelayer-with-treeview-onclick/m-p/184221#M17120</guid>
      <dc:creator>KenBuja</dc:creator>
      <dc:date>2015-01-28T21:34:42Z</dc:date>
    </item>
    <item>
      <title>Re: Loading FeatureLayer with Treeview.OnClick</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/loading-featurelayer-with-treeview-onclick/m-p/184222#M17121</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;K&lt;/P&gt;&lt;P&gt;Thank you so much for your services.&lt;/P&gt;&lt;P&gt;K&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 28 Jan 2015 21:39:25 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/loading-featurelayer-with-treeview-onclick/m-p/184222#M17121</guid>
      <dc:creator>KeithAnderson</dc:creator>
      <dc:date>2015-01-28T21:39:25Z</dc:date>
    </item>
  </channel>
</rss>

