<?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: Zoom to Feature extremely slow in ArcGIS JavaScript Maps SDK Questions</title>
    <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/zoom-to-feature-extremely-slow/m-p/134912#M12548</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;BLOCKQUOTE class="jive-quote"&gt;Hi All,&lt;BR /&gt;I am using the following code snippet straight from the javascript API examples and it appears to be working. However, it takes up to 10 seconds to complete the redraw (map.setExtent) by which time the user has given up and assumes it did not work. The feature layer I am using has about 60,000 polygons in it. Any ideas on how I can make this work and speed things up? Perhaps a different method than below?&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN style="font-style:italic;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; function zoomRow(id){&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; statesLayer.clearSelection();&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; var query = new esri.tasks.Query();&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; query.objectIds = [id];&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; statesLayer.selectFeatures(query,esri.layers.FeatureLayer.SELECTION_NEW,function(features){&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; //zoom to the selected feature&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; var stateExtent = features[0].geometry.getExtent().expand(5.0);&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; map.setExtent(stateExtent);&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; });&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;/SPAN&gt;&lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;That exceeds the recommended limits for graphics.&amp;nbsp; Remember a Feature Layer is a graphic with added functionality, rendering that much each time is excessive.&amp;nbsp; &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Can you either filter or generalize ?&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 28 Nov 2012 14:49:24 GMT</pubDate>
    <dc:creator>JeffPace</dc:creator>
    <dc:date>2012-11-28T14:49:24Z</dc:date>
    <item>
      <title>Zoom to Feature extremely slow</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/zoom-to-feature-extremely-slow/m-p/134911#M12547</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hi All,&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;I am using the following code snippet straight from the javascript API examples and it appears to be working. However, it takes up to 10 seconds to complete the redraw (map.setExtent) by which time the user has given up and assumes it did not work. The feature layer I am using has about 60,000 polygons in it. Any ideas on how I can make this work and speed things up? Perhaps a different method than below?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN style="font-style:italic;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; function zoomRow(id){&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; statesLayer.clearSelection();&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; var query = new esri.tasks.Query();&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; query.objectIds = [id];&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; statesLayer.selectFeatures(query,esri.layers.FeatureLayer.SELECTION_NEW,function(features){&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; //zoom to the selected feature&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; var stateExtent = features[0].geometry.getExtent().expand(5.0);&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; map.setExtent(stateExtent);&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; });&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 28 Nov 2012 14:36:39 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/zoom-to-feature-extremely-slow/m-p/134911#M12547</guid>
      <dc:creator>RobertBorowski</dc:creator>
      <dc:date>2012-11-28T14:36:39Z</dc:date>
    </item>
    <item>
      <title>Re: Zoom to Feature extremely slow</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/zoom-to-feature-extremely-slow/m-p/134912#M12548</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;BLOCKQUOTE class="jive-quote"&gt;Hi All,&lt;BR /&gt;I am using the following code snippet straight from the javascript API examples and it appears to be working. However, it takes up to 10 seconds to complete the redraw (map.setExtent) by which time the user has given up and assumes it did not work. The feature layer I am using has about 60,000 polygons in it. Any ideas on how I can make this work and speed things up? Perhaps a different method than below?&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN style="font-style:italic;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; function zoomRow(id){&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; statesLayer.clearSelection();&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; var query = new esri.tasks.Query();&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; query.objectIds = [id];&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; statesLayer.selectFeatures(query,esri.layers.FeatureLayer.SELECTION_NEW,function(features){&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; //zoom to the selected feature&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; var stateExtent = features[0].geometry.getExtent().expand(5.0);&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; map.setExtent(stateExtent);&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; });&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;/SPAN&gt;&lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;That exceeds the recommended limits for graphics.&amp;nbsp; Remember a Feature Layer is a graphic with added functionality, rendering that much each time is excessive.&amp;nbsp; &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Can you either filter or generalize ?&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 28 Nov 2012 14:49:24 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/zoom-to-feature-extremely-slow/m-p/134912#M12548</guid>
      <dc:creator>JeffPace</dc:creator>
      <dc:date>2012-11-28T14:49:24Z</dc:date>
    </item>
    <item>
      <title>Re: Zoom to Feature extremely slow</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/zoom-to-feature-extremely-slow/m-p/134913#M12549</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;The layer is parcel polygons. The user could be searching for any one of them, so they can't really be filtered to a smaller set. Just curious, what is the recommended limit? I see the ESRI example only is using the 50 states.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 28 Nov 2012 15:37:01 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/zoom-to-feature-extremely-slow/m-p/134913#M12549</guid>
      <dc:creator>RobertBorowski</dc:creator>
      <dc:date>2012-11-28T15:37:01Z</dc:date>
    </item>
    <item>
      <title>Re: Zoom to Feature extremely slow</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/zoom-to-feature-extremely-slow/m-p/134914#M12550</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Our parcel layer is 200k+.&amp;nbsp; Anything other that a tiled service was unacceptable performance.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Just because you are querying a service does not mean you have to display it.&amp;nbsp; In fact, it doesnt even need to be added to the map. &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;First thing i would do would be put big scale dependencies on display.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 28 Nov 2012 15:46:58 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/zoom-to-feature-extremely-slow/m-p/134914#M12550</guid>
      <dc:creator>JeffPace</dc:creator>
      <dc:date>2012-11-28T15:46:58Z</dc:date>
    </item>
    <item>
      <title>Re: Zoom to Feature extremely slow</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/zoom-to-feature-extremely-slow/m-p/134915#M12551</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;BLOCKQUOTE class="jive-quote"&gt;Our parcel layer is 200k+.&amp;nbsp; Anything other that a tiled service was unacceptable performance.&lt;BR /&gt;&lt;BR /&gt;Just because you are querying a service does not mean you have to display it.&amp;nbsp; In fact, it doesnt even need to be added to the map. &lt;BR /&gt;&lt;BR /&gt;First thing i would do would be put big scale dependencies on display.&lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;SPAN&gt; &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks for the insight Jeff. I do have scale dependencies set, but I should have mentioned that the map display is the whole point. The intention here is to do exactly what the ESRI States code sample does: Zoom in to a particular extent around the polygon (expand(5.0)) and highlight it on the map. Finding the extent of a queried polygon and then just resetting the map extent seemed to be the easiest way to do this. Maybe I am missing something here.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 28 Nov 2012 15:58:11 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/zoom-to-feature-extremely-slow/m-p/134915#M12551</guid>
      <dc:creator>RobertBorowski</dc:creator>
      <dc:date>2012-11-28T15:58:11Z</dc:date>
    </item>
    <item>
      <title>Re: Zoom to Feature extremely slow</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/zoom-to-feature-extremely-slow/m-p/134916#M12552</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;BLOCKQUOTE class="jive-quote"&gt;Thanks for the insight Jeff. I do have scale dependencies set, but I should have mentioned that the map display is the whole point. The intention here is to do exactly what the ESRI States code sample does: Zoom in to a particular extent around the polygon (expand(5.0)) and highlight it on the map. Finding the extent of a queried polygon and then just resetting the map extent seemed to be the easiest way to do this. Maybe I am missing something here.&lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;SPAN&gt; &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Understood.&amp;nbsp;&amp;nbsp; My guess is that it is the selection process that is the most time consuming.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Can you try a querytask instead of a selection? Since you will be receiving one geometry back, you can get its extent and do your calculation.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 28 Nov 2012 16:02:32 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/zoom-to-feature-extremely-slow/m-p/134916#M12552</guid>
      <dc:creator>JeffPace</dc:creator>
      <dc:date>2012-11-28T16:02:32Z</dc:date>
    </item>
    <item>
      <title>Re: Zoom to Feature extremely slow</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/zoom-to-feature-extremely-slow/m-p/134917#M12553</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Spot-on Jeff. I reconfigured it without the selectFeatures and just focused on the query... Then added the feature highlight as a graphic after the fact. Works great now!&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 28 Nov 2012 22:29:17 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/zoom-to-feature-extremely-slow/m-p/134917#M12553</guid>
      <dc:creator>RobertBorowski</dc:creator>
      <dc:date>2012-11-28T22:29:17Z</dc:date>
    </item>
  </channel>
</rss>

