<?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: layerView.queryExtent returns null if features are not in current map extent in ArcGIS JavaScript Maps SDK Questions</title>
    <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/layerview-queryextent-returns-null-if-features-are/m-p/1094931#M74530</link>
    <description>&lt;P&gt;The LayerView only has features that are currently displayed in the browser. When you query the extent of them, it only has the information to calculate the extent of displayed features. If you need the true extent of the data source, you can use the layer.queryExtentI() method or if defined, layer.fullExtent property of the layer.&lt;/P&gt;</description>
    <pubDate>Thu, 02 Sep 2021 15:13:46 GMT</pubDate>
    <dc:creator>ReneRubalcava</dc:creator>
    <dc:date>2021-09-02T15:13:46Z</dc:date>
    <item>
      <title>layerView.queryExtent returns null if features are not in current map extent</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/layerview-queryextent-returns-null-if-features-are/m-p/1094920#M74529</link>
      <description>&lt;P&gt;I'm using the follow snippet of code to zoom to the extent of graphics in a featurelayer. It works great when the map starts at the full extent. If I remove some graphics and add new graphics that are in an area that is not currently visible on the map, the queryExtent returns a null extent. However, if I add code to zoom to the full extent of the map first, then the queryExtent returns the extent. Anyone know how I can get this to work without zooming home each time I want to zoom to the extent of the layer?&amp;nbsp;&lt;/P&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;function&lt;/SPAN&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;zoomToLayer&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;layer&lt;/SPAN&gt;&lt;SPAN&gt;)&amp;nbsp;{&lt;/SPAN&gt;&lt;/DIV&gt;&lt;BR /&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;/*first&amp;nbsp;zoom&amp;nbsp;to&amp;nbsp;home&amp;nbsp;to&amp;nbsp;get&amp;nbsp;around&amp;nbsp;queryExtent&amp;nbsp;bug.&amp;nbsp;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;Getting&amp;nbsp;the&amp;nbsp;queryExtent&amp;nbsp;for&amp;nbsp;a&amp;nbsp;&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;layerview&amp;nbsp;does&amp;nbsp;not&amp;nbsp;work&amp;nbsp;if&amp;nbsp;the&amp;nbsp;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;extent&amp;nbsp;of&amp;nbsp;the&amp;nbsp;features&amp;nbsp;is&amp;nbsp;not&amp;nbsp;visible&amp;nbsp;in&amp;nbsp;the&amp;nbsp;map&amp;nbsp;*/&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; /*&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;view&lt;/SPAN&gt;&lt;SPAN&gt;.&lt;/SPAN&gt;&lt;SPAN&gt;goTo&lt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;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;//&amp;nbsp;wait&amp;nbsp;for&amp;nbsp;the&amp;nbsp;layer&amp;nbsp;view&amp;nbsp;to&amp;nbsp;finish&amp;nbsp;updating&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;if&lt;/SPAN&gt;&lt;SPAN&gt;&amp;nbsp;(!&lt;/SPAN&gt;&lt;SPAN&gt;val&lt;/SPAN&gt;&lt;SPAN&gt;)&amp;nbsp;{&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;layerView&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;then&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;function&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;response&lt;/SPAN&gt;&lt;SPAN&gt;)&amp;nbsp;{&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;console&lt;/SPAN&gt;&lt;SPAN&gt;.&lt;/SPAN&gt;&lt;SPAN&gt;log&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;response&lt;/SPAN&gt;&lt;SPAN&gt;);&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;//remove&amp;nbsp;the&amp;nbsp;layer&amp;nbsp;updating&amp;nbsp;watch&amp;nbsp;handler&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;handle&lt;/SPAN&gt;&lt;SPAN&gt;.&lt;/SPAN&gt;&lt;SPAN&gt;remove&lt;/SPAN&gt;&lt;SPAN&gt;();&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;//&amp;nbsp;go&amp;nbsp;to&amp;nbsp;the&amp;nbsp;extent&amp;nbsp;of&amp;nbsp;all&amp;nbsp;the&amp;nbsp;graphics&amp;nbsp;in&amp;nbsp;the&amp;nbsp;layer&amp;nbsp;view&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;view&lt;/SPAN&gt;&lt;SPAN&gt;.&lt;/SPAN&gt;&lt;SPAN&gt;goTo&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;response&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;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;});&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;}&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;});&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;});&lt;/SPAN&gt;&lt;/DIV&gt;&lt;BR /&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;}&lt;/SPAN&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;</description>
      <pubDate>Thu, 02 Sep 2021 14:46:46 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/layerview-queryextent-returns-null-if-features-are/m-p/1094920#M74529</guid>
      <dc:creator>Strahanjen</dc:creator>
      <dc:date>2021-09-02T14:46:46Z</dc:date>
    </item>
    <item>
      <title>Re: layerView.queryExtent returns null if features are not in current map extent</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/layerview-queryextent-returns-null-if-features-are/m-p/1094931#M74530</link>
      <description>&lt;P&gt;The LayerView only has features that are currently displayed in the browser. When you query the extent of them, it only has the information to calculate the extent of displayed features. If you need the true extent of the data source, you can use the layer.queryExtentI() method or if defined, layer.fullExtent property of the layer.&lt;/P&gt;</description>
      <pubDate>Thu, 02 Sep 2021 15:13:46 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/layerview-queryextent-returns-null-if-features-are/m-p/1094931#M74530</guid>
      <dc:creator>ReneRubalcava</dc:creator>
      <dc:date>2021-09-02T15:13:46Z</dc:date>
    </item>
    <item>
      <title>Re: layerView.queryExtent returns null if features are not in current map extent</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/layerview-queryextent-returns-null-if-features-are/m-p/1094937#M74531</link>
      <description>&lt;P&gt;&lt;SPAN&gt;Glad to have that explanation. I'm not sure I can switch to using layer.queryExtent because I'm working with a client side FeatureLayer. According to the documentation:&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;"Note that when working with client-side FeatureLayers, you will need to call&amp;nbsp;&lt;/SPAN&gt;&lt;A href="https://developers.arcgis.com/javascript/latest/api-reference/esri-views-layers-FeatureLayerView.html#queryExtent" target="_blank"&gt;queryExtent()&lt;/A&gt;&lt;SPAN&gt;&amp;nbsp;on the&amp;nbsp;&lt;/SPAN&gt;&lt;A href="https://developers.arcgis.com/javascript/latest/api-reference/esri-views-layers-FeatureLayerView.html" target="_blank"&gt;FeatureLayerView&lt;/A&gt;&lt;SPAN&gt;&amp;nbsp;to see the expected behavior."&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;Any other suggestions?&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Jennifer&lt;/P&gt;</description>
      <pubDate>Thu, 02 Sep 2021 15:20:33 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/layerview-queryextent-returns-null-if-features-are/m-p/1094937#M74531</guid>
      <dc:creator>Strahanjen</dc:creator>
      <dc:date>2021-09-02T15:20:33Z</dc:date>
    </item>
    <item>
      <title>Re: layerView.queryExtent returns null if features are not in current map extent</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/layerview-queryextent-returns-null-if-features-are/m-p/1094941#M74533</link>
      <description>&lt;P&gt;Are you using applyEdits to add features to the layer or adding them via source when creating it?&amp;nbsp; If that's the case, you can still use layer.queryExtent() and it will work. It's still client-side.&lt;/P&gt;</description>
      <pubDate>Thu, 02 Sep 2021 15:22:46 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/layerview-queryextent-returns-null-if-features-are/m-p/1094941#M74533</guid>
      <dc:creator>ReneRubalcava</dc:creator>
      <dc:date>2021-09-02T15:22:46Z</dc:date>
    </item>
    <item>
      <title>Re: layerView.queryExtent returns null if features are not in current map extent</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/layerview-queryextent-returns-null-if-features-are/m-p/1095413#M74554</link>
      <description>&lt;P&gt;Hi there,&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/7384"&gt;@ReneRubalcava&lt;/a&gt;&amp;nbsp;is 100% correct. Please use the FeatureLayer.queryExtent() to zoom to the full extent of all features stored in your client-side feature collection especially if the features are being added or removed.&lt;/P&gt;&lt;P&gt;I will update the sample description accordingly since it is outdated.&lt;/P&gt;&lt;P&gt;-Undral&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 03 Sep 2021 19:17:39 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/layerview-queryextent-returns-null-if-features-are/m-p/1095413#M74554</guid>
      <dc:creator>UndralBatsukh</dc:creator>
      <dc:date>2021-09-03T19:17:39Z</dc:date>
    </item>
    <item>
      <title>Re: layerView.queryExtent returns null if features are not in current map extent</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/layerview-queryextent-returns-null-if-features-are/m-p/1504977#M85030</link>
      <description>&lt;P&gt;Would like to clarify on this topic a little further. If I am interpreting the original post right, the intended approach is:&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;Load all features for a FeatureLayer to the map.&lt;/LI&gt;&lt;LI&gt;Add a definitionExpression to the FeatureLayer to filter the layer.&lt;/LI&gt;&lt;LI&gt;Set the map extent to the extent of the filtered FeatureLayer.&lt;/LI&gt;&lt;LI&gt;Change the definitionExpression on the FeatureLayer to filter to another feature or feature set in an area not currently in the view.&lt;/LI&gt;&lt;LI&gt;Set the map extent to that of the updated filtered FeatureLayer.&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;The goal is to do this without having to query the service to get the extent of the filtered FeatureLayer. Considering the FeatureLayer is already loaded to the client, another query to the service should not be necessary. I have been experimenting with the same approach.&lt;/P&gt;&lt;P&gt;&lt;A href="https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#queryExtent" target="_self"&gt;The docs&lt;/A&gt; for FeatureLayer.queryExtent() state “To query for the extent of features/graphics available to or visible in the View on the client rather than making a server-side query, you must use the FeatureLayerView.queryExtent() method.”&lt;/P&gt;&lt;P&gt;This would indicate that the approach above is not possible without zooming back out to the full FeatureLayer extent prior to setting the map extent the second time. Running FeatureLayer.queryExtent() will result in another query to the service. Running FeatureLayerView.queryExtent() will not query the service but it will not correctly set the map extent unless the next feature set is in the view when FeatureLayerView.queryExtent() is executed.&lt;/P&gt;&lt;P&gt;I did some testing, and what I am seeing indicates that running FeatureLayer.queryExtent() DOES query the service. Running FeatureLayerView.queryExtent() does not query the service.&lt;/P&gt;&lt;P&gt;Am I missing something?&lt;/P&gt;</description>
      <pubDate>Fri, 12 Jul 2024 18:35:27 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/layerview-queryextent-returns-null-if-features-are/m-p/1504977#M85030</guid>
      <dc:creator>Jeff-Reinhart</dc:creator>
      <dc:date>2024-07-12T18:35:27Z</dc:date>
    </item>
  </channel>
</rss>

