<?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: Help with Zoom to Feature Layer based on Query Selection_New in ArcGIS API for Flex Questions</title>
    <link>https://community.esri.com/t5/arcgis-api-for-flex-questions/help-with-zoom-to-feature-layer-based-on-query/m-p/183273#M4299</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;John,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; In your selectionComplete function you use the AsyncToken that is returned and get the features array and feed that array to a GraphicUtil object and call the getGraphicsExtent method to get a extent and then you feed that to the myMap.zoomTo.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 05 Jun 2014 17:16:45 GMT</pubDate>
    <dc:creator>RobertScheitlin__GISP</dc:creator>
    <dc:date>2014-06-05T17:16:45Z</dc:date>
    <item>
      <title>Help with Zoom to Feature Layer based on Query Selection_New</title>
      <link>https://community.esri.com/t5/arcgis-api-for-flex-questions/help-with-zoom-to-feature-layer-based-on-query/m-p/183272#M4298</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Greetings all, &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; For some reason I'm having a bit of difficulty getting my zoom to feature layer work.&amp;nbsp; The&amp;nbsp; following clears the previously selected route (mySelectedRouteLayer) then utilizing the route they selected returns the "ROUTE" number I use to create a SELECTION_NEW from the Feature Layer and display that layer.&amp;nbsp; It will clear the feature layer when they select the next one my problem is that I can't seem to figure out how to zoom to this particularly selected feature.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I was using the myMap.zoomTo(graphic.geometry); but since I no longer use the Graphic Layer I'm not sure how to get the geometry out of my FeatureLayer to zoomTo it.&amp;nbsp; &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Your input is greatly appreciated. Thank you in advance.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="plain" name="code"&gt;mySelectedRouteLayer.clear(); var graphic:Graphic; graphic = List(event.currentTarget).selectedItem as Graphic; var selectedRoute:int = graphic.attributes["ROUTE"]; query_Selection.where = "ROUTE = " + selectedRoute + ""; mySelectedRouteLayer.selectFeatures(query_Selection, FeatureLayer.SELECTION_NEW); mySelectedRouteLayer.selectionColor = NaN; // Zoomto the Extent of mySelectedRouteLayer&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 05 Jun 2014 17:09:00 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-flex-questions/help-with-zoom-to-feature-layer-based-on-query/m-p/183272#M4298</guid>
      <dc:creator>JohnRitsko</dc:creator>
      <dc:date>2014-06-05T17:09:00Z</dc:date>
    </item>
    <item>
      <title>Re: Help with Zoom to Feature Layer based on Query Selection_New</title>
      <link>https://community.esri.com/t5/arcgis-api-for-flex-questions/help-with-zoom-to-feature-layer-based-on-query/m-p/183273#M4299</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;John,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; In your selectionComplete function you use the AsyncToken that is returned and get the features array and feed that array to a GraphicUtil object and call the getGraphicsExtent method to get a extent and then you feed that to the myMap.zoomTo.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 05 Jun 2014 17:16:45 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-flex-questions/help-with-zoom-to-feature-layer-based-on-query/m-p/183273#M4299</guid>
      <dc:creator>RobertScheitlin__GISP</dc:creator>
      <dc:date>2014-06-05T17:16:45Z</dc:date>
    </item>
    <item>
      <title>Re: Help with Zoom to Feature Layer based on Query Selection_New</title>
      <link>https://community.esri.com/t5/arcgis-api-for-flex-questions/help-with-zoom-to-feature-layer-based-on-query/m-p/183274#M4300</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Robert,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt; I tried something like that using this code below but it seems to zoom to all the features progressively as you keep selecting more of them.&amp;nbsp; So the first time you run the application and select a route it doesn't move at all.&amp;nbsp; Then once you select the next feature it seems to zoom to the extent of the two routes.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;
var ac:ArrayCollection = mySelectedRouteLayer.graphicProvider as ArrayCollection;
myMap.zoomTo(GraphicUtil.getGraphicsExtent( ac.toArray()) );
&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BLOCKQUOTE class="jive-quote"&gt;John,&lt;BR /&gt;&lt;BR /&gt;&amp;nbsp; In your selectionComplete function you use the AsyncToken that is returned and get the features array and feed that array to a GraphicUtil object and call the getGraphicsExtent method to get a extent and then you feed that to the myMap.zoomTo.&lt;/BLOCKQUOTE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Dec 2021 09:19:56 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-flex-questions/help-with-zoom-to-feature-layer-based-on-query/m-p/183274#M4300</guid>
      <dc:creator>JohnRitsko</dc:creator>
      <dc:date>2021-12-11T09:19:56Z</dc:date>
    </item>
    <item>
      <title>Re: Help with Zoom to Feature Layer based on Query Selection_New</title>
      <link>https://community.esri.com/t5/arcgis-api-for-flex-questions/help-with-zoom-to-feature-layer-based-on-query/m-p/183275#M4301</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;John,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp; If you follow my advice on getting the features array from the AsyncToken in the selectionComplete function (and not the graphicsPrivider) than you should be ok.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 05 Jun 2014 17:26:30 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-flex-questions/help-with-zoom-to-feature-layer-based-on-query/m-p/183275#M4301</guid>
      <dc:creator>RobertScheitlin__GISP</dc:creator>
      <dc:date>2014-06-05T17:26:30Z</dc:date>
    </item>
    <item>
      <title>Re: Help with Zoom to Feature Layer based on Query Selection_New</title>
      <link>https://community.esri.com/t5/arcgis-api-for-flex-questions/help-with-zoom-to-feature-layer-based-on-query/m-p/183276#M4302</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Robert,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt; Thanks, I'm going to try and get that working.&amp;nbsp; I'll keep you posted and thanks for the input, much, much appreciated.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BLOCKQUOTE class="jive-quote"&gt;John,&lt;BR /&gt;&lt;BR /&gt;&amp;nbsp;&amp;nbsp; If you follow my advice on getting the features array from the AsyncToken in the selectionComplete function (and not the graphicsPrivider) than you should be ok.&lt;/BLOCKQUOTE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 05 Jun 2014 17:28:03 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-flex-questions/help-with-zoom-to-feature-layer-based-on-query/m-p/183276#M4302</guid>
      <dc:creator>JohnRitsko</dc:creator>
      <dc:date>2014-06-05T17:28:03Z</dc:date>
    </item>
    <item>
      <title>Re: Help with Zoom to Feature Layer based on Query Selection_New</title>
      <link>https://community.esri.com/t5/arcgis-api-for-flex-questions/help-with-zoom-to-feature-layer-based-on-query/m-p/183277#M4303</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Robert,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt; I can't put the GraphicUtil in the creationComplete function as it stores the extent of all my routes which is run only once when the program loads.&amp;nbsp; As such, it zooms to all of the routes only once and then never moves from there. The creationComplete function stores the geometry of my routes as routeList.dataProvider=new ArrayCollection(featureSet.features);&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; I use a change event based on this routeList to get an attribute from the list in order to query stops and routes.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Perhaps you can help me think about how to address this.&amp;nbsp; Thanks.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;
protected function routeList_changeHandler(event:IndexChangeEvent):void
{
 mySelectedRouteLayer.clear();

 var graphic:Graphic = List(event.currentTarget).selectedItem as Graphic;
 var selectedRoute:int = graphic.attributes["ROUTE"];
&amp;nbsp;&amp;nbsp;&amp;nbsp; 
 query_Selection.where = "ROUTE = " + selectedRoute + "";
 mySelectedRouteLayer.selectFeatures(query_Selection, FeatureLayer.SELECTION_NEW);
 mySelectedRouteLayer.selectionColor = NaN;
 highlightStops(graphic); 
 
/* var routeExtent:Extent = GraphicUtil.getGraphicsExtent(graphic.toArray()); */
/* myMap.extent = routeExtent; */
&amp;nbsp;&amp;nbsp;&amp;nbsp; 
 var ac:ArrayCollection = mySelectedRouteLayer.graphicProvider as ArrayCollection;
 myMap.zoomTo(GraphicUtil.getGraphicsExtent(ac.toArray())); 
} 
&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Dec 2021 09:19:58 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-flex-questions/help-with-zoom-to-feature-layer-based-on-query/m-p/183277#M4303</guid>
      <dc:creator>JohnRitsko</dc:creator>
      <dc:date>2021-12-11T09:19:58Z</dc:date>
    </item>
    <item>
      <title>Re: Help with Zoom to Feature Layer based on Query Selection_New</title>
      <link>https://community.esri.com/t5/arcgis-api-for-flex-questions/help-with-zoom-to-feature-layer-based-on-query/m-p/183278#M4304</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;John,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp; Do you have a selectionComplete function?.. I mentioned that you need to use this function in both of my last posts.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 05 Jun 2014 21:25:13 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-flex-questions/help-with-zoom-to-feature-layer-based-on-query/m-p/183278#M4304</guid>
      <dc:creator>RobertScheitlin__GISP</dc:creator>
      <dc:date>2014-06-05T21:25:13Z</dc:date>
    </item>
    <item>
      <title>Re: Help with Zoom to Feature Layer based on Query Selection_New</title>
      <link>https://community.esri.com/t5/arcgis-api-for-flex-questions/help-with-zoom-to-feature-layer-based-on-query/m-p/183279#M4305</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I have a creationComplete function and I tried what you said but I personally couldn't get it working.&amp;nbsp; I've taken one 2 day course on Flex so I'm still very new to this.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;
protected function doQuery():void
{ 
 queryTask.execute(query, new AsyncResponder(onResult, onFault));
 function onResult(featureSet:FeatureSet, token:Object = null):void
 {
&amp;nbsp; routeList.dataProvider = new ArrayCollection(featureSet.features);
 }
 function onFault(info:Object, token:Object = null):void
 {
&amp;nbsp; Alert.show( info.toString() );
 }
}


&amp;lt;s:List id="routeList"
&amp;nbsp; x="10" y="10"
&amp;nbsp; width="225" height="575" 
&amp;nbsp; rollOverColor="#CCCCCC"
&amp;nbsp; horizontalScrollPolicy="on"
&amp;nbsp; creationComplete="doQuery()"
&amp;nbsp; change="routeList_changeHandler(event)"&amp;gt; 
&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Dec 2021 09:20:02 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-flex-questions/help-with-zoom-to-feature-layer-based-on-query/m-p/183279#M4305</guid>
      <dc:creator>JohnRitsko</dc:creator>
      <dc:date>2021-12-11T09:20:02Z</dc:date>
    </item>
    <item>
      <title>Re: Help with Zoom to Feature Layer based on Query Selection_New</title>
      <link>https://community.esri.com/t5/arcgis-api-for-flex-questions/help-with-zoom-to-feature-layer-based-on-query/m-p/183280#M4306</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;John,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp; You started out asking about a FeatureLayer.SelectFeatures, now you are talking about a QueryTask... Maybe you should just post all of your code in a zip file for me to look at and see exactly what you are attempting.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 06 Jun 2014 10:31:18 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-flex-questions/help-with-zoom-to-feature-layer-based-on-query/m-p/183280#M4306</guid>
      <dc:creator>RobertScheitlin__GISP</dc:creator>
      <dc:date>2014-06-06T10:31:18Z</dc:date>
    </item>
    <item>
      <title>Re: Help with Zoom to Feature Layer based on Query Selection_New</title>
      <link>https://community.esri.com/t5/arcgis-api-for-flex-questions/help-with-zoom-to-feature-layer-based-on-query/m-p/183281#M4307</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Sorry for delayed response.&amp;nbsp; I managed to simply use the geometry of the graphic to zoom to the extent of.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="plain" name="code"&gt;protected function routeList_changeHandler(event:IndexChangeEvent):void&amp;nbsp;&amp;nbsp; {&amp;nbsp; mySelectedRouteLayer.clear();&amp;nbsp;&amp;nbsp;&amp;nbsp; var graphic:Graphic = List(event.currentTarget).selectedItem as Graphic;&amp;nbsp; var selectedRoute:int = graphic.attributes["ROUTE"];&amp;nbsp; query_Selection.where = "ROUTE = " + selectedRoute + "";&amp;nbsp; mySelectedRouteLayer.selectFeatures(query_Selection, FeatureLayer.SELECTION_NEW);&amp;nbsp; mySelectedRouteLayer.selectionColor = NaN;&amp;nbsp; highlightStops(graphic);&amp;nbsp;&amp;nbsp; myMap.zoomTo(graphic.geometry.extent);&amp;nbsp; }&amp;nbsp; &lt;/PRE&gt;&lt;DIV style="display:none;"&gt; &lt;/DIV&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 16 Jun 2014 15:16:32 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-flex-questions/help-with-zoom-to-feature-layer-based-on-query/m-p/183281#M4307</guid>
      <dc:creator>JohnRitsko</dc:creator>
      <dc:date>2014-06-16T15:16:32Z</dc:date>
    </item>
  </channel>
</rss>

