<?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: Issues trying to remove a feature layer from the map in ArcGIS JavaScript Maps SDK Questions</title>
    <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/issues-trying-to-remove-a-feature-layer-from-the/m-p/468982#M43496</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Like this:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;var fireFeature0 = new esri.layers.FeatureLayer(fireFeatureUrl0 + "?token=" + editToken, {
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; mode: esri.layers.FeatureLayer.MODE_ONDEMAND,
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; outFields: ['*']
&amp;nbsp;&amp;nbsp;&amp;nbsp; });&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Then I would use:&amp;nbsp; map.removeLayer(fireFeature0);&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Of course, the Url and editToken are defined above but within the same function that is loading the layer, should they be global also maybe?&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Sat, 11 Dec 2021 20:47:30 GMT</pubDate>
    <dc:creator>MarcusBush</dc:creator>
    <dc:date>2021-12-11T20:47:30Z</dc:date>
    <item>
      <title>Issues trying to remove a feature layer from the map</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/issues-trying-to-remove-a-feature-layer-from-the/m-p/468980#M43494</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hello,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I searched this forum and did find a vaguely similar post and tried the solution, unfortunately it did not help me though.&amp;nbsp; I made sure to make the variable for the feature layer global.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I have a JavaScript application in MVC and am trying to remove a feature layer using "map.removeLayer(nameOfFeatureLayerObject)" and it isn't working for me, the graphics from the layer remain on my map.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I had read that there may be an issue if they are associated with an existing editor or any other widget, and they are.&amp;nbsp; So, just before the .removeLayer() I have tried .destroy() on the editor and template picker dijits that the layer is being used in, and it still remains.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;An important note, these feature layers are brought in using a token, as they are secure.&amp;nbsp; Could this have something to do with my issue?&amp;nbsp; Also, this particular app is on 3.5 of the jsapi.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks in advance for any advice.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 07 Apr 2014 17:26:38 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/issues-trying-to-remove-a-feature-layer-from-the/m-p/468980#M43494</guid>
      <dc:creator>MarcusBush</dc:creator>
      <dc:date>2014-04-07T17:26:38Z</dc:date>
    </item>
    <item>
      <title>Re: Issues trying to remove a feature layer from the map</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/issues-trying-to-remove-a-feature-layer-from-the/m-p/468981#M43495</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;BLOCKQUOTE class="jive-quote"&gt;Hello,&lt;BR /&gt;&lt;BR /&gt;I searched this forum and did find a vaguely similar post and tried the solution, unfortunately it did not help me though.&amp;nbsp; I made sure to make the variable for the feature layer global.&lt;BR /&gt;&lt;BR /&gt;I have a JavaScript application in MVC and am trying to remove a feature layer using "map.removeLayer(nameOfFeatureLayerObject)" and it isn't working for me, the graphics from the layer remain on my map.&lt;BR /&gt;&lt;BR /&gt;I had read that there may be an issue if they are associated with an existing editor or any other widget, and they are.&amp;nbsp; So, just before the .removeLayer() I have tried .destroy() on the editor and template picker dijits that the layer is being used in, and it still remains.&lt;BR /&gt;&lt;BR /&gt;An important note, these feature layers are brought in using a token, as they are secure.&amp;nbsp; Could this have something to do with my issue?&amp;nbsp; Also, this particular app is on 3.5 of the jsapi.&lt;BR /&gt;&lt;BR /&gt;Thanks in advance for any advice.&lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;You mention nameOfFeatureLayerObject on your message. What does this variable holds? A layer reference or a string with the layer name?&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 07 Apr 2014 20:51:08 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/issues-trying-to-remove-a-feature-layer-from-the/m-p/468981#M43495</guid>
      <dc:creator>RobertoPepato</dc:creator>
      <dc:date>2014-04-07T20:51:08Z</dc:date>
    </item>
    <item>
      <title>Re: Issues trying to remove a feature layer from the map</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/issues-trying-to-remove-a-feature-layer-from-the/m-p/468982#M43496</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Like this:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;var fireFeature0 = new esri.layers.FeatureLayer(fireFeatureUrl0 + "?token=" + editToken, {
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; mode: esri.layers.FeatureLayer.MODE_ONDEMAND,
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; outFields: ['*']
&amp;nbsp;&amp;nbsp;&amp;nbsp; });&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Then I would use:&amp;nbsp; map.removeLayer(fireFeature0);&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Of course, the Url and editToken are defined above but within the same function that is loading the layer, should they be global also maybe?&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Dec 2021 20:47:30 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/issues-trying-to-remove-a-feature-layer-from-the/m-p/468982#M43496</guid>
      <dc:creator>MarcusBush</dc:creator>
      <dc:date>2021-12-11T20:47:30Z</dc:date>
    </item>
    <item>
      <title>Re: Issues trying to remove a feature layer from the map</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/issues-trying-to-remove-a-feature-layer-from-the/m-p/468983#M43497</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;BLOCKQUOTE class="jive-quote"&gt;Like this:&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;var fireFeature0 = new esri.layers.FeatureLayer(fireFeatureUrl0 + "?token=" + editToken, {
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; mode: esri.layers.FeatureLayer.MODE_ONDEMAND,
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; outFields: ['*']
&amp;nbsp;&amp;nbsp;&amp;nbsp; });&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;Then I would use:&amp;nbsp; map.removeLayer(fireFeature0);&lt;BR /&gt;&lt;BR /&gt;Of course, the Url and editToken are defined above but within the same function that is loading the layer, should they be global also maybe?&lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;SPAN&gt; &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Humm.. I don't think so. Are you using a public feature layer? It would be possible to post the full source code so I can reproduce the problem from my end and try some debugging?&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Dec 2021 20:47:33 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/issues-trying-to-remove-a-feature-layer-from-the/m-p/468983#M43497</guid>
      <dc:creator>RobertoPepato</dc:creator>
      <dc:date>2021-12-11T20:47:33Z</dc:date>
    </item>
  </channel>
</rss>

