<?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 Update and FullExtent in ArcGIS API for Silverlight Questions</title>
    <link>https://community.esri.com/t5/arcgis-api-for-silverlight-questions/featurelayer-update-and-fullextent/m-p/176399#M4409</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Update is a asyncronous method. In other words you have to give the server a chance to send a response back.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Instead wait for the myFeatureLayer.UpdateCompleted event to fire before you do the zoom.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 04 Jun 2010 23:29:08 GMT</pubDate>
    <dc:creator>dotMorten_esri</dc:creator>
    <dc:date>2010-06-04T23:29:08Z</dc:date>
    <item>
      <title>FeatureLayer Update and FullExtent</title>
      <link>https://community.esri.com/t5/arcgis-api-for-silverlight-questions/featurelayer-update-and-fullextent/m-p/176398#M4408</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I would like to do something similar to this&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;myFeatureLayer.Where = "a=b"&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;myFeatureLayer.Update()&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;myMap.ZoomTo(myFeatureLayer.FullExtent)&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;However, after calling the Update method, the FullExtent is null.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks for any help/ideas.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 04 Jun 2010 21:37:29 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-silverlight-questions/featurelayer-update-and-fullextent/m-p/176398#M4408</guid>
      <dc:creator>CurtThue</dc:creator>
      <dc:date>2010-06-04T21:37:29Z</dc:date>
    </item>
    <item>
      <title>Re: FeatureLayer Update and FullExtent</title>
      <link>https://community.esri.com/t5/arcgis-api-for-silverlight-questions/featurelayer-update-and-fullextent/m-p/176399#M4409</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Update is a asyncronous method. In other words you have to give the server a chance to send a response back.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Instead wait for the myFeatureLayer.UpdateCompleted event to fire before you do the zoom.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 04 Jun 2010 23:29:08 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-silverlight-questions/featurelayer-update-and-fullextent/m-p/176399#M4409</guid>
      <dc:creator>dotMorten_esri</dc:creator>
      <dc:date>2010-06-04T23:29:08Z</dc:date>
    </item>
    <item>
      <title>Re: FeatureLayer Update and FullExtent</title>
      <link>https://community.esri.com/t5/arcgis-api-for-silverlight-questions/featurelayer-update-and-fullextent/m-p/176400#M4410</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;BLOCKQUOTE class="jive-quote"&gt; Update is a asyncronous method. In other words you have to give the server a chance to send a response back.&amp;nbsp; &lt;BR /&gt;Instead wait for the myFeatureLayer.UpdateCompleted event to fire before you do the zoom.&lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;SPAN&gt; &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Morten&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I added a handler for UpdateCompleted. It works as expected the first time, however the event also fires when the map is panned, zoomed, etc. The API docs define the event as "&lt;/SPAN&gt;&lt;SPAN style="font-style:italic;"&gt;fires after an explicit call to Update() or after the layer has initialized and features was returned from the feature layer service."&lt;/SPAN&gt;&lt;SPAN&gt; I am not sure why it fires when the extent is changed.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;My code:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN style="font-size: &amp;quot;1&amp;quot;; font-family: &amp;quot;Courier New&amp;quot;;"&gt; private void QueryButton_Click2(object sender, RoutedEventArgs e)&lt;BR /&gt; {&lt;BR /&gt; string searchCriteria = string.Empty;&lt;BR /&gt; FeatureLayer projFeatureLayer = MyMap.Layers["ProjectPoints1"] as FeatureLayer;&lt;BR /&gt;&lt;BR /&gt; projFeatureLayer.UpdateCompleted += new System.EventHandler(projFeatureLayer_UpdateCompleted);&lt;BR /&gt; projFeatureLayer.UpdateFailed += new System.EventHandler&amp;lt;ESRI.ArcGIS.Client.Tasks.TaskFailedEventArgs&amp;gt;(projFeatureLayer_UpdateFailed);&lt;BR /&gt;&lt;BR /&gt; searchCriteria = QueryTextBox.Text;&lt;BR /&gt;&lt;BR /&gt; projFeatureLayer.Where = searchCriteria;&lt;BR /&gt; projFeatureLayer.Update();&lt;BR /&gt; }&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt; void projFeatureLayer_UpdateCompleted(object sender, System.EventArgs e)&lt;BR /&gt; {&lt;BR /&gt;&lt;BR /&gt; FeatureLayer projFeatureLayer = (FeatureLayer)sender;&lt;BR /&gt;&lt;BR /&gt; if (projFeatureLayer.FullExtent != null)&lt;BR /&gt; {&lt;BR /&gt;&lt;BR /&gt; double projectXMin = projFeatureLayer.FullExtent.XMin;&lt;BR /&gt; double projectXMax = projFeatureLayer.FullExtent.XMax;&lt;BR /&gt; double projectYMin = projFeatureLayer.FullExtent.YMin;&lt;BR /&gt; double projectYMax = projFeatureLayer.FullExtent.YMax;&lt;BR /&gt; double coordOffset = .01;&lt;BR /&gt;&lt;BR /&gt; //Envelope cannot be a single point?&lt;BR /&gt; if (projectXMin == projectXMax &amp;amp;&amp;amp; projectYMin == projectYMax)&lt;BR /&gt; {&lt;BR /&gt; projectXMax = projectXMax + coordOffset;&lt;BR /&gt; projectXMin = projectXMin - coordOffset;&lt;BR /&gt; }&lt;BR /&gt;&lt;BR /&gt; Envelope projectEnvelope = new Envelope(projectXMin, projectYMin, projectXMax, projectYMax);&lt;BR /&gt; MyMap.ZoomTo(projectEnvelope);&lt;BR /&gt; }&lt;BR /&gt; }&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Any help is appreciated!&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 07 Jun 2010 15:03:06 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-silverlight-questions/featurelayer-update-and-fullextent/m-p/176400#M4410</guid>
      <dc:creator>CurtThue</dc:creator>
      <dc:date>2010-06-07T15:03:06Z</dc:date>
    </item>
    <item>
      <title>Re: FeatureLayer Update and FullExtent</title>
      <link>https://community.esri.com/t5/arcgis-api-for-silverlight-questions/featurelayer-update-and-fullextent/m-p/176401#M4411</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I'm guessing you have OnDemand mode enabled?&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;The doc should mention that this also triggers an update.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 07 Jun 2010 15:18:09 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-silverlight-questions/featurelayer-update-and-fullextent/m-p/176401#M4411</guid>
      <dc:creator>dotMorten_esri</dc:creator>
      <dc:date>2010-06-07T15:18:09Z</dc:date>
    </item>
    <item>
      <title>Re: FeatureLayer Update and FullExtent</title>
      <link>https://community.esri.com/t5/arcgis-api-for-silverlight-questions/featurelayer-update-and-fullextent/m-p/176402#M4412</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;BLOCKQUOTE class="jive-quote"&gt;I'm guessing you have OnDemand mode enabled?&lt;BR /&gt;The doc should mention that this also triggers an update.&lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;SPAN&gt; &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks, it now works as expected. I assumed that specifying a WHERE value on the FeatureLayer would take it out of OnDemand (my interpretation of the API docs).&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 07 Jun 2010 21:15:54 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-silverlight-questions/featurelayer-update-and-fullextent/m-p/176402#M4412</guid>
      <dc:creator>CurtThue</dc:creator>
      <dc:date>2010-06-07T21:15:54Z</dc:date>
    </item>
  </channel>
</rss>

