<?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: Filter a GEOJSON layer by one property in ArcGIS JavaScript Maps SDK Questions</title>
    <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/filter-a-geojson-layer-by-one-property/m-p/1058557#M73127</link>
    <description>&lt;P&gt;Using the ArcGIS API for JavaScript, it doesn't look like there's a filter method like the sample you linked to, but you could &lt;A href="https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-GeoJSONLayer.html#createQuery" target="_self"&gt;query the GeoJSON layer&lt;/A&gt; and display the query results. Alternatively, you could use plain JS to &lt;A href="https://stackoverflow.com/a/2722213" target="_self"&gt;filter the GeoJSON object&lt;/A&gt;.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;let filteredFeatures = myFeatureCollection.features.filter(function (feature) {
  return feature.properties.category == "Volcanoes";
});&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Mon, 17 May 2021 15:15:08 GMT</pubDate>
    <dc:creator>BlakeTerhune</dc:creator>
    <dc:date>2021-05-17T15:15:08Z</dc:date>
    <item>
      <title>Filter a GEOJSON layer by one property</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/filter-a-geojson-layer-by-one-property/m-p/1058350#M73122</link>
      <description>&lt;P&gt;Hello!&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am working on a project, where I will&amp;nbsp; feature&amp;nbsp; lots interesting geological locations on a globe, using Arcgis API for Javascript. These locations will be featured in GEOJSON layer and people should be able to click on the symbols and a pop-up window with pictures and texts will appear. This works fine so far, but I would like to apply a filter. I assigned different categories to the selected locations, like "Volcanoes", "Mountains", "Reefs" and much more. I would like to add a filter, so that users can select for&amp;nbsp; example "Volcanoes" and just the volcanoes will be visible on the globe.&amp;nbsp;&lt;/P&gt;&lt;P&gt;I looked at tutorials (e.g. &lt;A href="https://developers.arcgis.com/javascript/latest/sample-code/featurefilter-attributes/" target="_blank"&gt;https://developers.arcgis.com/javascript/latest/sample-code/featurefilter-attributes/&lt;/A&gt;), but I am not able to apply it on my globe. I am beginner and probably I am doing something wrong. Is the sample code in link applicable for GEOJSON&amp;nbsp; layers as well?&amp;nbsp; Or maybe someone has another idea or knows about other tutorials or sample codes, that could help in this case.&amp;nbsp;&lt;/P&gt;&lt;P&gt;Below is a small excerpt of the GEOJSON file. There are more properties, but I would like to filter them only by the "category". The geometry type stays the same throughout the file.&lt;/P&gt;&lt;PRE&gt;{
  "type": "FeatureCollection",
  "features": [
    {
      "type": "Feature",
      "properties": {
        "name": "Mount Fuji",
        "category":"Volcanoes",
        "type": "...............",
        "location": "................",
        "description": "......"&lt;BR /&gt;},
      "geometry": {
        "type": "Point",
        "coordinates": [
          138.7275,
          35.360556
        ]
      }
    },&lt;BR /&gt;..&lt;BR /&gt;..&lt;BR /&gt;..&lt;/PRE&gt;&lt;P&gt;Thank you very much!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sun, 16 May 2021 19:54:19 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/filter-a-geojson-layer-by-one-property/m-p/1058350#M73122</guid>
      <dc:creator>JaninaGro5</dc:creator>
      <dc:date>2021-05-16T19:54:19Z</dc:date>
    </item>
    <item>
      <title>Re: Filter a GEOJSON layer by one property</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/filter-a-geojson-layer-by-one-property/m-p/1058557#M73127</link>
      <description>&lt;P&gt;Using the ArcGIS API for JavaScript, it doesn't look like there's a filter method like the sample you linked to, but you could &lt;A href="https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-GeoJSONLayer.html#createQuery" target="_self"&gt;query the GeoJSON layer&lt;/A&gt; and display the query results. Alternatively, you could use plain JS to &lt;A href="https://stackoverflow.com/a/2722213" target="_self"&gt;filter the GeoJSON object&lt;/A&gt;.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;let filteredFeatures = myFeatureCollection.features.filter(function (feature) {
  return feature.properties.category == "Volcanoes";
});&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 17 May 2021 15:15:08 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/filter-a-geojson-layer-by-one-property/m-p/1058557#M73127</guid>
      <dc:creator>BlakeTerhune</dc:creator>
      <dc:date>2021-05-17T15:15:08Z</dc:date>
    </item>
    <item>
      <title>Re: Filter a GEOJSON layer by one property</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/filter-a-geojson-layer-by-one-property/m-p/1058591#M73130</link>
      <description>&lt;P&gt;Hi there,&amp;nbsp;&lt;/P&gt;&lt;P&gt;The feature filters and effects can be applied on the &lt;A href="https://developers.arcgis.com/javascript/latest/api-reference/esri-views-layers-GeoJSONLayerView.html#filter" target="_self"&gt;GeoJSONLayerView&lt;/A&gt;&amp;nbsp;as you are describing in your question.&lt;/P&gt;&lt;P&gt;If you are not familiar with layer views and filters, please take a look at&lt;A href="https://developers.arcgis.com/javascript/latest/query-filter/" target="_self"&gt; this guide doc&lt;/A&gt; to understand how they work.&amp;nbsp;&lt;/P&gt;&lt;P&gt;I modified the sample you referenced in your question to filter features from GeoJSONLayerView. Take a look at&lt;A href="https://codepen.io/U_B_U/pen/xxqEOJZ?editors=100" target="_self"&gt; this test app&lt;/A&gt;.&amp;nbsp;&lt;/P&gt;&lt;P&gt;Hope this helps,&lt;/P&gt;&lt;P&gt;-Undral&lt;/P&gt;</description>
      <pubDate>Mon, 17 May 2021 16:13:43 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/filter-a-geojson-layer-by-one-property/m-p/1058591#M73130</guid>
      <dc:creator>UndralBatsukh</dc:creator>
      <dc:date>2021-05-17T16:13:43Z</dc:date>
    </item>
  </channel>
</rss>

