<?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: FeatureLayer bug when removing from map and adding back in ArcGIS JavaScript Maps SDK Questions</title>
    <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/featurelayer-bug-when-removing-from-map-and-adding/m-p/127411#M11792</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Do you have an Editor dijit associated with this Feature Layer ? I ran into alot troubles with removing and readding a Feature Layer when it was a child of a dijit.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I found that after removing the layer, if i destroyed dijit as well, all my problems went away&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;so &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;
editorWidget = new esri.dijit.editing.Editor(params,'editorDiv');

//on remove
map.removeLayer(layer);
editorWidget.destroy();

&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Sat, 11 Dec 2021 07:13:26 GMT</pubDate>
    <dc:creator>JeffPace</dc:creator>
    <dc:date>2021-12-11T07:13:26Z</dc:date>
    <item>
      <title>FeatureLayer bug when removing from map and adding back</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/featurelayer-bug-when-removing-from-map-and-adding/m-p/127409#M11790</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I have an application that removes a FeatureLayer from the map using map.removeLayer. Later on I add it back to the map. It shows up on the map, but if I call the featureLayer.selectFeatures on the layer it fails (never calls the callbacks).&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Stepping through the API I can see that the private variable _mode on the featureLayer is set to null when the layer is removed from the map, but never re-assigned when put back in the map. The selectFeatures code expects the _mode variable to be set. I believe this is a bug in the API.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Cheers,&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Christian.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 04 May 2012 15:00:13 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/featurelayer-bug-when-removing-from-map-and-adding/m-p/127409#M11790</guid>
      <dc:creator>ChristianMorin</dc:creator>
      <dc:date>2012-05-04T15:00:13Z</dc:date>
    </item>
    <item>
      <title>Re: FeatureLayer bug when removing from map and adding back</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/featurelayer-bug-when-removing-from-map-and-adding/m-p/127410#M11791</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hi Christian,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Can you provide code to reproduce this?&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 04 May 2012 18:22:24 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/featurelayer-bug-when-removing-from-map-and-adding/m-p/127410#M11791</guid>
      <dc:creator>derekswingley1</dc:creator>
      <dc:date>2012-05-04T18:22:24Z</dc:date>
    </item>
    <item>
      <title>Re: FeatureLayer bug when removing from map and adding back</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/featurelayer-bug-when-removing-from-map-and-adding/m-p/127411#M11792</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Do you have an Editor dijit associated with this Feature Layer ? I ran into alot troubles with removing and readding a Feature Layer when it was a child of a dijit.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I found that after removing the layer, if i destroyed dijit as well, all my problems went away&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;so &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;
editorWidget = new esri.dijit.editing.Editor(params,'editorDiv');

//on remove
map.removeLayer(layer);
editorWidget.destroy();

&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Dec 2021 07:13:26 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/featurelayer-bug-when-removing-from-map-and-adding/m-p/127411#M11792</guid>
      <dc:creator>JeffPace</dc:creator>
      <dc:date>2021-12-11T07:13:26Z</dc:date>
    </item>
    <item>
      <title>Re: FeatureLayer bug when removing from map and adding back</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/featurelayer-bug-when-removing-from-map-and-adding/m-p/127412#M11793</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hi Derek,&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; I've taken the On Demand sample from your site and added 2 buttons. One that will perform a query on the feature layer. The other will remove then add back the layer to the map.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; If you run the query first it will work. Then, if you remove/add the layer from the map, the query will not return at all (not success or failure). &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; I've also put some alerts to show what the problem is (the internal _mode property gets cleared in the process of remove/add) and this code fails silently in your API when queryFeatures is called on the feature layer.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Cheers,&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Christian.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 08 May 2012 20:21:04 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/featurelayer-bug-when-removing-from-map-and-adding/m-p/127412#M11793</guid>
      <dc:creator>ChristianMorin</dc:creator>
      <dc:date>2012-05-08T20:21:04Z</dc:date>
    </item>
  </channel>
</rss>

