<?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: Applying Filter to GroupLayers in the layerlist in ArcGIS JavaScript Maps SDK Questions</title>
    <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/applying-filter-to-grouplayers-in-the-layerlist/m-p/1220797#M78963</link>
    <description>&lt;P&gt;Popups will show for visible features on the map and you can zoom to an extent based on the filter. You need add that logic after you apply the filter.&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;  document.getElementById("statesFIPS").addEventListener("change", () =&amp;gt; {
view.allLayerViews.forEach((lv) =&amp;gt; {
  if (lv.layer.type === "feature") {
    lv.filter = {
      where: "STATE_FIPS = '" +
       document.getElementById("statesFIPS").value +"'"
     };
     // ZOOM HERE       
  }
});
        });&lt;/LI-CODE&gt;</description>
    <pubDate>Tue, 11 Oct 2022 16:44:22 GMT</pubDate>
    <dc:creator>UndralBatsukh</dc:creator>
    <dc:date>2022-10-11T16:44:22Z</dc:date>
    <item>
      <title>Applying Filter to GroupLayers in the layerlist</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/applying-filter-to-grouplayers-in-the-layerlist/m-p/1220680#M78954</link>
      <description>&lt;P&gt;I'm new to Javascript, so please bare with me.&lt;/P&gt;&lt;P&gt;I have created a similar layer list (&lt;A href="https://developers.arcgis.com/javascript/latest/sample-code/sandbox/?sample=widgets-layerlist-actions" target="_blank" rel="noopener"&gt;https://developers.arcgis.com/javascript/latest/sample-code/sandbox/?sample=widgets-layerlist-actions&lt;/A&gt;) but instead of having 1 group layer, I have several group layers, each containing multiple layers. All the layers being used contain a common field called CSDNAME. I was wondering if there is a way to create a filter ( &lt;A href="https://developers.arcgis.com/javascript/latest/sample-code/featurefilter-attributes/" target="_blank" rel="noopener"&gt;https://developers.arcgis.com/javascript/latest/sample-code/featurefilter-attributes/&lt;/A&gt;) that would filter out all the layers at once, and when toggling between different group layers and layers, the filter would be applied.&lt;/P&gt;&lt;P&gt;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/1104"&gt;@RobertScheitlin__GISP&lt;/a&gt;&amp;nbsp;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/53756"&gt;@UndralBatsukh&lt;/a&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 11 Oct 2022 19:48:02 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/applying-filter-to-grouplayers-in-the-layerlist/m-p/1220680#M78954</guid>
      <dc:creator>TheGamer</dc:creator>
      <dc:date>2022-10-11T19:48:02Z</dc:date>
    </item>
    <item>
      <title>Re: Applying Filter to GroupLayers in the layerlist</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/applying-filter-to-grouplayers-in-the-layerlist/m-p/1220773#M78961</link>
      <description>&lt;P&gt;Hi there,&amp;nbsp;&lt;/P&gt;&lt;P&gt;The FeatureFilter sample you referenced can only be used for feature based layers like FeatureLayer, CSVLayer, GeoJSONLayer etc. I created a simple test app that &lt;A href="https://developers.arcgis.com/javascript/latest/api-reference/esri-views-layers-FeatureLayerView.html#filter" target="_self"&gt;filters&lt;/A&gt; FeatureLayersViews based on same field names. In the app, I am only checking if the layer type is feature and set the filter. You should probably add more checks to make sure you are getting the right FeaturelayerViews.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;A href="https://codepen.io/U_B_U/pen/QWrzyeQ?editors=100" target="_blank"&gt;https://codepen.io/U_B_U/pen/QWrzyeQ?editors=100&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 11 Oct 2022 16:00:35 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/applying-filter-to-grouplayers-in-the-layerlist/m-p/1220773#M78961</guid>
      <dc:creator>UndralBatsukh</dc:creator>
      <dc:date>2022-10-11T16:00:35Z</dc:date>
    </item>
    <item>
      <title>Re: Applying Filter to GroupLayers in the layerlist</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/applying-filter-to-grouplayers-in-the-layerlist/m-p/1220776#M78962</link>
      <description>&lt;P&gt;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/53756"&gt;@UndralBatsukh&lt;/a&gt;&amp;nbsp;thank you so much. I have a question about your code. Is it possible to apply 'zoom to extent' on the filter?&lt;/P&gt;</description>
      <pubDate>Wed, 12 Oct 2022 14:39:59 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/applying-filter-to-grouplayers-in-the-layerlist/m-p/1220776#M78962</guid>
      <dc:creator>TheGamer</dc:creator>
      <dc:date>2022-10-12T14:39:59Z</dc:date>
    </item>
    <item>
      <title>Re: Applying Filter to GroupLayers in the layerlist</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/applying-filter-to-grouplayers-in-the-layerlist/m-p/1220797#M78963</link>
      <description>&lt;P&gt;Popups will show for visible features on the map and you can zoom to an extent based on the filter. You need add that logic after you apply the filter.&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;  document.getElementById("statesFIPS").addEventListener("change", () =&amp;gt; {
view.allLayerViews.forEach((lv) =&amp;gt; {
  if (lv.layer.type === "feature") {
    lv.filter = {
      where: "STATE_FIPS = '" +
       document.getElementById("statesFIPS").value +"'"
     };
     // ZOOM HERE       
  }
});
        });&lt;/LI-CODE&gt;</description>
      <pubDate>Tue, 11 Oct 2022 16:44:22 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/applying-filter-to-grouplayers-in-the-layerlist/m-p/1220797#M78963</guid>
      <dc:creator>UndralBatsukh</dc:creator>
      <dc:date>2022-10-11T16:44:22Z</dc:date>
    </item>
  </channel>
</rss>

