<?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: New featurelayer feature not showing up automatically in ArcGIS API for Flex Questions</title>
    <link>https://community.esri.com/t5/arcgis-api-for-flex-questions/new-featurelayer-feature-not-showing-up/m-p/286522#M6805</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Greetings Everyone, &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I ended up creating a MapPoint and setting it's x and y properties equal to the slightly adjusted center of the map's extent using the following chunk of code:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;var centerAt:MapPoint = new MapPoint;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;centerAt.x = map.extent.center.x; &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;centerAt.y = map.extent.center.y -0.1;//slight adjustment&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Following that, I reset the map's centerpoint to the slightly adjusted centerpoint with the following line of code. &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;map.centerAt(centerAt);&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;By readjusting the maps centerpoint my featuerLayer is forced to redraw and my new feature auto-magically appears. &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;While this works fine for my purposes, I can't help feeling like there is a better way. &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Any suggestions will be greatly appreciated. &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks, Tyler&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 27 Sep 2012 16:50:59 GMT</pubDate>
    <dc:creator>TylerWaring</dc:creator>
    <dc:date>2012-09-27T16:50:59Z</dc:date>
    <item>
      <title>New featurelayer feature not showing up automatically</title>
      <link>https://community.esri.com/t5/arcgis-api-for-flex-questions/new-featurelayer-feature-not-showing-up/m-p/286521#M6804</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Greetings Everyone, &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;I am editing a feature layer using the applyEdits and refresh methods like so:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;editFeatureLayer.applyEdits([ lastDrawnGraphic ], null, null); &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;editFeatureLayer.refresh();&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;The new feature gets recorded in the database but does not show up in the map automatically. To get the new feature to show up I have to manually pan or zoom in a little. &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;How do I get the new feature to display automatically?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks, Tyler&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 27 Sep 2012 12:54:49 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-flex-questions/new-featurelayer-feature-not-showing-up/m-p/286521#M6804</guid>
      <dc:creator>TylerWaring</dc:creator>
      <dc:date>2012-09-27T12:54:49Z</dc:date>
    </item>
    <item>
      <title>Re: New featurelayer feature not showing up automatically</title>
      <link>https://community.esri.com/t5/arcgis-api-for-flex-questions/new-featurelayer-feature-not-showing-up/m-p/286522#M6805</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Greetings Everyone, &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I ended up creating a MapPoint and setting it's x and y properties equal to the slightly adjusted center of the map's extent using the following chunk of code:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;var centerAt:MapPoint = new MapPoint;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;centerAt.x = map.extent.center.x; &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;centerAt.y = map.extent.center.y -0.1;//slight adjustment&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Following that, I reset the map's centerpoint to the slightly adjusted centerpoint with the following line of code. &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;map.centerAt(centerAt);&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;By readjusting the maps centerpoint my featuerLayer is forced to redraw and my new feature auto-magically appears. &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;While this works fine for my purposes, I can't help feeling like there is a better way. &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Any suggestions will be greatly appreciated. &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks, Tyler&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 27 Sep 2012 16:50:59 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-flex-questions/new-featurelayer-feature-not-showing-up/m-p/286522#M6805</guid>
      <dc:creator>TylerWaring</dc:creator>
      <dc:date>2012-09-27T16:50:59Z</dc:date>
    </item>
    <item>
      <title>Re: New featurelayer feature not showing up automatically</title>
      <link>https://community.esri.com/t5/arcgis-api-for-flex-questions/new-featurelayer-feature-not-showing-up/m-p/286523#M6806</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Try to set FeatureLayer.&lt;/SPAN&gt;&lt;A href="http://resources.arcgis.com/en/help/flex-api/apiref/com/esri/ags/layers/FeatureLayer.html#disableClientCaching"&gt;disableClientCaching&lt;/A&gt;&lt;SPAN&gt; = true.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Also, search this forum for 'disableClientCaching':&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;[ATTACH=CONFIG]18062[/ATTACH]&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 28 Sep 2012 05:38:08 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-flex-questions/new-featurelayer-feature-not-showing-up/m-p/286523#M6806</guid>
      <dc:creator>IvanBespalov</dc:creator>
      <dc:date>2012-09-28T05:38:08Z</dc:date>
    </item>
    <item>
      <title>Re: New featurelayer feature not showing up automatically</title>
      <link>https://community.esri.com/t5/arcgis-api-for-flex-questions/new-featurelayer-feature-not-showing-up/m-p/286524#M6807</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I just checked my client caching and I already have it disabled. Hmmm...&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks, Tyler&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 28 Sep 2012 11:48:35 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-flex-questions/new-featurelayer-feature-not-showing-up/m-p/286524#M6807</guid>
      <dc:creator>TylerWaring</dc:creator>
      <dc:date>2012-09-28T11:48:35Z</dc:date>
    </item>
    <item>
      <title>Re: New featurelayer feature not showing up automatically</title>
      <link>https://community.esri.com/t5/arcgis-api-for-flex-questions/new-featurelayer-feature-not-showing-up/m-p/286525#M6808</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hey Tyler,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I think you are calling layer.refresh() too soon. You can listen for the 'edits complete' event to fire on the feature layer and then call refresh()&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Something like:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;

editFeatureLayer.addEventListener(FeatureLayerEvent.EDITS_COMPLETE, editFeatureLayer_editsCompleteHandler);
editFeatureLayer.applyEdits([ lastDrawnGraphic ], null, null); 

private function editFeatureLayer_editsCompleteHandler(event:FeatureLayerEvent):void
{&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; // You can also check if the edit was a success
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; editFeatureLayer.refresh();
}

&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Hope that helps.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Dec 2021 13:50:49 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-flex-questions/new-featurelayer-feature-not-showing-up/m-p/286525#M6808</guid>
      <dc:creator>SarthakDatt</dc:creator>
      <dc:date>2021-12-11T13:50:49Z</dc:date>
    </item>
  </channel>
</rss>

