<?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 collection in Flutter in Flutter Maps SDK Questions</title>
    <link>https://community.esri.com/t5/flutter-maps-sdk-questions/zoom-to-feature-collection-in-flutter/m-p/1572225#M26</link>
    <description>&lt;P&gt;Instead of calling FeatureLayer.queryExtent, you can call FeatureTable.queryExtent:&lt;/P&gt;&lt;DIV&gt;&lt;PRE&gt;&lt;SPAN&gt;// Create a uri to a feature service.&lt;BR /&gt;&lt;/SPAN&gt;&lt;SPAN&gt;final &lt;/SPAN&gt;uri = Uri.&lt;SPAN&gt;parse&lt;/SPAN&gt;(&lt;BR /&gt;  &lt;SPAN&gt;'https://sampleserver6.arcgisonline.com/arcgis/rest/services/DamageAssessment/FeatureServer/0'&lt;/SPAN&gt;,&lt;BR /&gt;);&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;// Create a service feature table with the uri.&lt;BR /&gt;&lt;/SPAN&gt;&lt;SPAN&gt;final &lt;/SPAN&gt;serviceFeatureTable = &lt;SPAN&gt;ServiceFeatureTable&lt;/SPAN&gt;.&lt;SPAN&gt;withUri&lt;/SPAN&gt;(uri);&lt;BR /&gt;&lt;SPAN&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;SPAN&gt;// Apply a definition expression to filter features&lt;BR /&gt;&lt;/SPAN&gt;serviceFeatureTable.&lt;SPAN&gt;definitionExpression &lt;/SPAN&gt;= &lt;SPAN&gt;"firstname like '%a%'"&lt;/SPAN&gt;;&lt;BR /&gt;&lt;SPAN&gt;&lt;BR /&gt;// Create query parameters with the definition expression&lt;BR /&gt;final &lt;/SPAN&gt;queryParameters = &lt;SPAN&gt;QueryParameters&lt;/SPAN&gt;();&lt;BR /&gt;queryParameters.&lt;SPAN&gt;whereClause &lt;/SPAN&gt;= serviceFeatureTable.&lt;SPAN&gt;definitionExpression&lt;/SPAN&gt;;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;// Query the extent of features that match the definition expression&lt;BR /&gt;final &lt;/SPAN&gt;queryResult = &lt;SPAN&gt;await &lt;/SPAN&gt;serviceFeatureTable.queryExtent(queryParameters);&lt;BR /&gt;&lt;BR /&gt;// Create a feature layer with the service feature table&lt;BR /&gt;&lt;SPAN&gt;final &lt;/SPAN&gt;serviceFeatureLayer =&lt;BR /&gt;    &lt;SPAN&gt;FeatureLayer&lt;/SPAN&gt;.&lt;SPAN&gt;withFeatureTable&lt;/SPAN&gt;(serviceFeatureTable);&lt;BR /&gt;&lt;BR /&gt;// Add the feature layer to the map's operational layers&lt;BR /&gt;map.&lt;SPAN&gt;operationalLayers&lt;/SPAN&gt;.add(serviceFeatureLayer);&lt;BR /&gt;&lt;SPAN&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;SPAN&gt;// Load the map to ensure all layers are ready&lt;BR /&gt;await &lt;/SPAN&gt;map.load();&lt;BR /&gt;&lt;BR /&gt;// Set the map view to the extent of the queried features&lt;BR /&gt;&lt;SPAN&gt;_mapViewController&lt;/SPAN&gt;.setViewpointGeometry(queryResult.&lt;SPAN&gt;extent&lt;/SPAN&gt;);&lt;/PRE&gt;&lt;/DIV&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Thu, 02 Jan 2025 19:40:03 GMT</pubDate>
    <dc:creator>HarishK</dc:creator>
    <dc:date>2025-01-02T19:40:03Z</dc:date>
    <item>
      <title>Zoom to feature collection in Flutter</title>
      <link>https://community.esri.com/t5/flutter-maps-sdk-questions/zoom-to-feature-collection-in-flutter/m-p/1570983#M23</link>
      <description>&lt;P&gt;I've been trying to zoom to features after definition expression is applied. is there a way to direct zoom to all features which satisfies the definition expression? I already checked all examples, Could you please suggest something to do that?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;queryParameters&lt;/SPAN&gt;&lt;SPAN&gt;.&lt;/SPAN&gt;&lt;SPAN&gt;whereClause&lt;/SPAN&gt; &lt;SPAN&gt;=&lt;/SPAN&gt; &lt;SPAN&gt;featureLayer&lt;/SPAN&gt;&lt;SPAN&gt;.&lt;/SPAN&gt;&lt;SPAN&gt;definitionExpression&lt;/SPAN&gt;&lt;SPAN&gt;;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &lt;/SPAN&gt;&lt;SPAN&gt;//var feaureTable = FeatureLayer.withFeatureTable(featureTable);&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &lt;/SPAN&gt;&lt;SPAN&gt;final&lt;/SPAN&gt; &lt;SPAN&gt;queryResult&lt;/SPAN&gt; &lt;SPAN&gt;=&lt;/SPAN&gt; &lt;SPAN&gt;await&lt;/SPAN&gt; &lt;SPAN&gt;featureTable&lt;/SPAN&gt;&lt;SPAN&gt;.&lt;/SPAN&gt;&lt;SPAN&gt;queryExtent&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;queryParameters&lt;/SPAN&gt;&lt;SPAN&gt;);&lt;/SPAN&gt;&lt;/DIV&gt;&lt;BR /&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &lt;/SPAN&gt;&lt;SPAN&gt;// Query the extent of features that match the definition expression&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &lt;/SPAN&gt;&lt;SPAN&gt;// final QueryResult result =&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &lt;/SPAN&gt;&lt;SPAN&gt;// &amp;nbsp;await _featureLayer.queryExtent(queryParams: queryParams);&lt;/SPAN&gt;&lt;/DIV&gt;&lt;BR /&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &lt;/SPAN&gt;&lt;SPAN&gt;// Get the map controller&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &lt;/SPAN&gt;&lt;SPAN&gt;// final controller = await _mapControllerCompleter.future;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;BR /&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &lt;/SPAN&gt;&lt;SPAN&gt;// Zoom to the filtered extent&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &lt;/SPAN&gt;&lt;SPAN&gt;await&lt;/SPAN&gt; &lt;SPAN&gt;_mapViewController&lt;/SPAN&gt;&lt;SPAN&gt;.&lt;/SPAN&gt;&lt;SPAN&gt;setViewpointGeometry&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;queryResult&lt;/SPAN&gt;&lt;SPAN&gt;.&lt;/SPAN&gt;&lt;SPAN&gt;extent&lt;/SPAN&gt;&lt;SPAN&gt;);&lt;/SPAN&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 23 Dec 2024 16:38:17 GMT</pubDate>
      <guid>https://community.esri.com/t5/flutter-maps-sdk-questions/zoom-to-feature-collection-in-flutter/m-p/1570983#M23</guid>
      <dc:creator>vijaybadugu</dc:creator>
      <dc:date>2024-12-23T16:38:17Z</dc:date>
    </item>
    <item>
      <title>Re: Zoom to feature collection in Flutter</title>
      <link>https://community.esri.com/t5/flutter-maps-sdk-questions/zoom-to-feature-collection-in-flutter/m-p/1572225#M26</link>
      <description>&lt;P&gt;Instead of calling FeatureLayer.queryExtent, you can call FeatureTable.queryExtent:&lt;/P&gt;&lt;DIV&gt;&lt;PRE&gt;&lt;SPAN&gt;// Create a uri to a feature service.&lt;BR /&gt;&lt;/SPAN&gt;&lt;SPAN&gt;final &lt;/SPAN&gt;uri = Uri.&lt;SPAN&gt;parse&lt;/SPAN&gt;(&lt;BR /&gt;  &lt;SPAN&gt;'https://sampleserver6.arcgisonline.com/arcgis/rest/services/DamageAssessment/FeatureServer/0'&lt;/SPAN&gt;,&lt;BR /&gt;);&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;// Create a service feature table with the uri.&lt;BR /&gt;&lt;/SPAN&gt;&lt;SPAN&gt;final &lt;/SPAN&gt;serviceFeatureTable = &lt;SPAN&gt;ServiceFeatureTable&lt;/SPAN&gt;.&lt;SPAN&gt;withUri&lt;/SPAN&gt;(uri);&lt;BR /&gt;&lt;SPAN&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;SPAN&gt;// Apply a definition expression to filter features&lt;BR /&gt;&lt;/SPAN&gt;serviceFeatureTable.&lt;SPAN&gt;definitionExpression &lt;/SPAN&gt;= &lt;SPAN&gt;"firstname like '%a%'"&lt;/SPAN&gt;;&lt;BR /&gt;&lt;SPAN&gt;&lt;BR /&gt;// Create query parameters with the definition expression&lt;BR /&gt;final &lt;/SPAN&gt;queryParameters = &lt;SPAN&gt;QueryParameters&lt;/SPAN&gt;();&lt;BR /&gt;queryParameters.&lt;SPAN&gt;whereClause &lt;/SPAN&gt;= serviceFeatureTable.&lt;SPAN&gt;definitionExpression&lt;/SPAN&gt;;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;// Query the extent of features that match the definition expression&lt;BR /&gt;final &lt;/SPAN&gt;queryResult = &lt;SPAN&gt;await &lt;/SPAN&gt;serviceFeatureTable.queryExtent(queryParameters);&lt;BR /&gt;&lt;BR /&gt;// Create a feature layer with the service feature table&lt;BR /&gt;&lt;SPAN&gt;final &lt;/SPAN&gt;serviceFeatureLayer =&lt;BR /&gt;    &lt;SPAN&gt;FeatureLayer&lt;/SPAN&gt;.&lt;SPAN&gt;withFeatureTable&lt;/SPAN&gt;(serviceFeatureTable);&lt;BR /&gt;&lt;BR /&gt;// Add the feature layer to the map's operational layers&lt;BR /&gt;map.&lt;SPAN&gt;operationalLayers&lt;/SPAN&gt;.add(serviceFeatureLayer);&lt;BR /&gt;&lt;SPAN&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;SPAN&gt;// Load the map to ensure all layers are ready&lt;BR /&gt;await &lt;/SPAN&gt;map.load();&lt;BR /&gt;&lt;BR /&gt;// Set the map view to the extent of the queried features&lt;BR /&gt;&lt;SPAN&gt;_mapViewController&lt;/SPAN&gt;.setViewpointGeometry(queryResult.&lt;SPAN&gt;extent&lt;/SPAN&gt;);&lt;/PRE&gt;&lt;/DIV&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 02 Jan 2025 19:40:03 GMT</pubDate>
      <guid>https://community.esri.com/t5/flutter-maps-sdk-questions/zoom-to-feature-collection-in-flutter/m-p/1572225#M26</guid>
      <dc:creator>HarishK</dc:creator>
      <dc:date>2025-01-02T19:40:03Z</dc:date>
    </item>
  </channel>
</rss>

