<?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: creating a filter (query?) in Open Source Mapping Libraries Ques.</title>
    <link>https://community.esri.com/t5/open-source-mapping-libraries-ques/creating-a-filter-query/m-p/780558#M176</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;instead of fetching &lt;EM&gt;all&lt;/EM&gt; the features from the service and filtering on the client, it's a better to only ask ArcGIS Online/Server for the features you want (using the &lt;A href="http://esri.github.io/esri-leaflet/api-reference/layers/feature-layer.html#options"&gt;where&lt;/A&gt; constructor option).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;DIV style="color: #d4d4d4; background-color: #1e1e1e; font-weight: normal; font-size: 12px;"&gt;&lt;DIV&gt;&lt;SPAN style="color: #9cdcfe;"&gt;L&lt;/SPAN&gt;&lt;SPAN style="color: #d4d4d4;"&gt;.&lt;/SPAN&gt;&lt;SPAN style="color: #9cdcfe;"&gt;esri&lt;/SPAN&gt;&lt;SPAN style="color: #d4d4d4;"&gt;.&lt;/SPAN&gt;&lt;SPAN style="color: #dcdcaa;"&gt;featureLayer&lt;/SPAN&gt;&lt;SPAN style="color: #d4d4d4;"&gt;({&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN style="color: #9cdcfe;"&gt;&amp;nbsp; url:&lt;/SPAN&gt;&lt;SPAN style="color: #d4d4d4;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #ce9178;"&gt;&lt;SPAN&gt;"&lt;/SPAN&gt;&lt;A class="jive-link-external-small" href="https://community.esri.com/external-link.jspa?url=http%3A%2F%2Fsampleserver6.arcgisonline.com%2Farcgis%2Frest%2Fservices%2FCensus%2FMapServer%2F3" rel="nofollow" target="_blank"&gt;http://sampleserver6.arcgisonline.com/arcgis/rest/services/Census/MapServer/3&lt;/A&gt;&lt;SPAN&gt;"&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN style="color: #d4d4d4;"&gt;,&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN style="color: #9cdcfe;"&gt;&amp;nbsp; where:&lt;/SPAN&gt;&lt;SPAN style="color: #d4d4d4;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #ce9178;"&gt;"STATE_NAME = 'Kansas'"&lt;/SPAN&gt;&lt;SPAN style="color: #d4d4d4;"&gt;,&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN style="color: #d4d4d4;"&gt;}).&lt;/SPAN&gt;&lt;SPAN style="color: #dcdcaa;"&gt;addTo&lt;/SPAN&gt;&lt;SPAN style="color: #d4d4d4;"&gt;(&lt;/SPAN&gt;&lt;SPAN style="color: #9cdcfe;"&gt;map&lt;/SPAN&gt;&lt;SPAN style="color: #d4d4d4;"&gt;);&lt;/SPAN&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;A class="link-titled" href="http://esri.github.io/esri-leaflet/examples/querying-feature-layers-1.html" title="http://esri.github.io/esri-leaflet/examples/querying-feature-layers-1.html"&gt;Querying features | Esri Leaflet&lt;/A&gt;&amp;nbsp;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 17 Jul 2018 17:02:50 GMT</pubDate>
    <dc:creator>JohnGravois</dc:creator>
    <dc:date>2018-07-17T17:02:50Z</dc:date>
    <item>
      <title>creating a filter (query?)</title>
      <link>https://community.esri.com/t5/open-source-mapping-libraries-ques/creating-a-filter-query/m-p/780556#M174</link>
      <description>&lt;P&gt;I am using esri's feature service and ersi-leaflet library to display my map.&amp;nbsp; The following code snippet is used to display&lt;/P&gt;
&lt;P&gt;the countries&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;&lt;SPAN&gt;featureURL = "&lt;/SPAN&gt;&lt;A class="jive-link-external-small" href="http://dev.xxxxx.org/arcgis/rest/services/MEP/noRelate_tester/FeatureServer/0" target="_blank" rel="nofollow noopener"&gt;http://dev.xxxxx.org/arcgis/rest/services/MEP/noRelate_tester/FeatureServer/0&lt;/A&gt;&lt;SPAN&gt;"&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;var countries = L.esri.featureLayer(featureURL,&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;{&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp; &lt;SPAN&gt;style: getStyle,&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;&amp;nbsp; &lt;SPAN&gt;onEachFeature: onEachFeature&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;}&lt;SPAN&gt;).addTo(map);&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;At this time, it is displaying all the countries.&lt;/P&gt;
&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I'd like to display (or highlight) only the countries that satisfies a certain filter or query.&lt;/P&gt;
&lt;P&gt;For example, I want to display only the countries that satisfy the filter/query type = SDG.&lt;/P&gt;
&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I reviewed the docs and examples for esri-leaflet library but am totally lost as to how use the query method.&lt;/P&gt;
&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Can someone point me to an example that show how to use the filter/query to do the above&lt;/P&gt;
&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks&lt;/P&gt;
&lt;P&gt;Chris&lt;/P&gt;</description>
      <pubDate>Mon, 28 Aug 2023 13:10:01 GMT</pubDate>
      <guid>https://community.esri.com/t5/open-source-mapping-libraries-ques/creating-a-filter-query/m-p/780556#M174</guid>
      <dc:creator>joepublic</dc:creator>
      <dc:date>2023-08-28T13:10:01Z</dc:date>
    </item>
    <item>
      <title>Re: creating a filter (query?)</title>
      <link>https://community.esri.com/t5/open-source-mapping-libraries-ques/creating-a-filter-query/m-p/780557#M175</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;The query method has examples on&amp;nbsp;&lt;A href="https://esri.github.io/esri-leaflet" rel="nofollow noopener noreferrer" target="_blank"&gt;Esri Leaflet&lt;/A&gt;.&lt;/P&gt;&lt;P&gt;Example 1:&amp;nbsp;&lt;A href="https://esri.github.io/esri-leaflet/examples/querying-feature-layers-1.html" rel="nofollow noopener noreferrer" target="_blank"&gt;https://esri.github.io/esri-leaflet/examples/querying-feature-layers-1.html&lt;/A&gt;&lt;/P&gt;&lt;P&gt;Example 2:&amp;nbsp;&lt;A href="https://esri.github.io/esri-leaflet/examples/querying-feature-layers-2.html" rel="nofollow noopener noreferrer" target="_blank"&gt;https://esri.github.io/esri-leaflet/examples/querying-feature-layers-2.html&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;From &lt;A href="https://github.com/Esri/esri-leaflet/issues" rel="nofollow noopener noreferrer" target="_blank"&gt;Esri Leaflet Issues&lt;/A&gt;, I found a problem similar to yours.&amp;nbsp;&lt;/P&gt;&lt;P&gt;Since you pass a GeoJSON feature you have access to attributes, like the "filter" attribute.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&lt;CODE&gt;&lt;SPAN class="keyword token"&gt;function&lt;/SPAN&gt; &lt;SPAN class="token function"&gt;filter&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;feature&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt; &lt;SPAN class="punctuation token"&gt;{&lt;/SPAN&gt;
&amp;nbsp;&amp;nbsp; &lt;SPAN class="keyword token"&gt;return&lt;/SPAN&gt; feature&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;properties&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;type &lt;SPAN class="operator token"&gt;===&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;"SDG"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt;
&lt;SPAN class="punctuation token"&gt;}&lt;/SPAN&gt;

&lt;SPAN class="keyword token"&gt;var&lt;/SPAN&gt; countries &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; L&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;esri&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;&lt;SPAN class="token function"&gt;featureLayer&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;featureURL&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;{&lt;/SPAN&gt;
&amp;nbsp; filter&lt;SPAN class="punctuation token"&gt;:&lt;/SPAN&gt; filter&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt;
&amp;nbsp; style&lt;SPAN class="punctuation token"&gt;:&lt;/SPAN&gt; getStyle&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt;
&amp;nbsp; onEachFeature&lt;SPAN class="punctuation token"&gt;:&lt;/SPAN&gt; onEachFeature
&lt;SPAN class="punctuation token"&gt;}&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;&lt;SPAN class="token function"&gt;addTo&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;map&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt;‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍&lt;SPAN class="line-numbers-rows"&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Issue #214:&amp;nbsp;&lt;A href="https://github.com/Esri/esri-leaflet/issues/214" rel="nofollow noopener noreferrer" target="_blank"&gt;https://github.com/Esri/esri-leaflet/issues/214&lt;/A&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 12 Dec 2021 08:49:01 GMT</pubDate>
      <guid>https://community.esri.com/t5/open-source-mapping-libraries-ques/creating-a-filter-query/m-p/780557#M175</guid>
      <dc:creator>WinstonHoyle</dc:creator>
      <dc:date>2021-12-12T08:49:01Z</dc:date>
    </item>
    <item>
      <title>Re: creating a filter (query?)</title>
      <link>https://community.esri.com/t5/open-source-mapping-libraries-ques/creating-a-filter-query/m-p/780558#M176</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;instead of fetching &lt;EM&gt;all&lt;/EM&gt; the features from the service and filtering on the client, it's a better to only ask ArcGIS Online/Server for the features you want (using the &lt;A href="http://esri.github.io/esri-leaflet/api-reference/layers/feature-layer.html#options"&gt;where&lt;/A&gt; constructor option).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;DIV style="color: #d4d4d4; background-color: #1e1e1e; font-weight: normal; font-size: 12px;"&gt;&lt;DIV&gt;&lt;SPAN style="color: #9cdcfe;"&gt;L&lt;/SPAN&gt;&lt;SPAN style="color: #d4d4d4;"&gt;.&lt;/SPAN&gt;&lt;SPAN style="color: #9cdcfe;"&gt;esri&lt;/SPAN&gt;&lt;SPAN style="color: #d4d4d4;"&gt;.&lt;/SPAN&gt;&lt;SPAN style="color: #dcdcaa;"&gt;featureLayer&lt;/SPAN&gt;&lt;SPAN style="color: #d4d4d4;"&gt;({&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN style="color: #9cdcfe;"&gt;&amp;nbsp; url:&lt;/SPAN&gt;&lt;SPAN style="color: #d4d4d4;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #ce9178;"&gt;&lt;SPAN&gt;"&lt;/SPAN&gt;&lt;A class="jive-link-external-small" href="https://community.esri.com/external-link.jspa?url=http%3A%2F%2Fsampleserver6.arcgisonline.com%2Farcgis%2Frest%2Fservices%2FCensus%2FMapServer%2F3" rel="nofollow" target="_blank"&gt;http://sampleserver6.arcgisonline.com/arcgis/rest/services/Census/MapServer/3&lt;/A&gt;&lt;SPAN&gt;"&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN style="color: #d4d4d4;"&gt;,&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN style="color: #9cdcfe;"&gt;&amp;nbsp; where:&lt;/SPAN&gt;&lt;SPAN style="color: #d4d4d4;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #ce9178;"&gt;"STATE_NAME = 'Kansas'"&lt;/SPAN&gt;&lt;SPAN style="color: #d4d4d4;"&gt;,&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN style="color: #d4d4d4;"&gt;}).&lt;/SPAN&gt;&lt;SPAN style="color: #dcdcaa;"&gt;addTo&lt;/SPAN&gt;&lt;SPAN style="color: #d4d4d4;"&gt;(&lt;/SPAN&gt;&lt;SPAN style="color: #9cdcfe;"&gt;map&lt;/SPAN&gt;&lt;SPAN style="color: #d4d4d4;"&gt;);&lt;/SPAN&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;A class="link-titled" href="http://esri.github.io/esri-leaflet/examples/querying-feature-layers-1.html" title="http://esri.github.io/esri-leaflet/examples/querying-feature-layers-1.html"&gt;Querying features | Esri Leaflet&lt;/A&gt;&amp;nbsp;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 17 Jul 2018 17:02:50 GMT</pubDate>
      <guid>https://community.esri.com/t5/open-source-mapping-libraries-ques/creating-a-filter-query/m-p/780558#M176</guid>
      <dc:creator>JohnGravois</dc:creator>
      <dc:date>2018-07-17T17:02:50Z</dc:date>
    </item>
  </channel>
</rss>

