<?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: Can I filter a FeatureLayer by a custom geometry in ArcGIS Web AppBuilder Questions</title>
    <link>https://community.esri.com/t5/arcgis-web-appbuilder-questions/can-i-filter-a-featurelayer-by-a-custom-geometry/m-p/612810#M16197</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Mike,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp;Your workflow should be do a &lt;A href="https://developers.arcgis.com/javascript/3/jsapi/featurelayer-amd.html#queryids"&gt;queryIds&lt;/A&gt;&amp;nbsp;on the FeatureLayer to get the ids that the geometry intersect with and then&amp;nbsp;use the FeatureLayers &lt;A href="https://developers.arcgis.com/javascript/3/jsapi/featurelayer-amd.html#setdefinitionexpression"&gt;setDefinitionExpression&lt;/A&gt;&amp;nbsp;using a sql statement like ObjectID IN (your results from the Ids query array.join()).&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 28 Mar 2018 13:38:11 GMT</pubDate>
    <dc:creator>RobertScheitlin__GISP</dc:creator>
    <dc:date>2018-03-28T13:38:11Z</dc:date>
    <item>
      <title>Can I filter a FeatureLayer by a custom geometry</title>
      <link>https://community.esri.com/t5/arcgis-web-appbuilder-questions/can-i-filter-a-featurelayer-by-a-custom-geometry/m-p/612809#M16196</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi I'm using ArcGIS JS API 3.21 and Web Appbuilder for Developers 2.7.&lt;/P&gt;&lt;P&gt;I'm&amp;nbsp;defining and adding a feature layer from a map service to my map, giving it a custom unique value renderer and setting a definition expression and it is working fine. The final&amp;nbsp;thing I need to do is to filter it by a custom polygon geometry. In the service you can pass custom geometry to a query, I just need to find out how to set a filter on my feature layer using the same geometry.&lt;/P&gt;&lt;P&gt;I've tried using MODE_SELECTION and then selecting features with the geometry, but this gets rid of my unique value renderer in favour of the selection symbol. I'm pretty sure I can't set a unique value renderer as the selection symbol and even then that would be a bit hacky.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The user needs to generate a custom selection of features from the map using attribute filtering and custom polygon filtering, and once they are happy with their selection the features are submitted via a HTTP request to an ordering system. The user only wants their currently selected features to appear on the map.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Something like this would be good:&lt;/P&gt;&lt;DIV style="color: #d4d4d4; background-color: #1e1e1e; font-weight: normal; font-size: 14px;"&gt;&lt;DIV&gt;&lt;SPAN style="color: #569cd6;"&gt;var&lt;/SPAN&gt;&lt;SPAN style="color: #d4d4d4;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #9cdcfe;"&gt;featureLayer&lt;/SPAN&gt;&lt;SPAN style="color: #d4d4d4;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #d4d4d4;"&gt;=&lt;/SPAN&gt;&lt;SPAN style="color: #d4d4d4;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #569cd6;"&gt;new&lt;/SPAN&gt;&lt;SPAN style="color: #d4d4d4;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #4ec9b0;"&gt;FeatureLayer&lt;/SPAN&gt;&lt;SPAN style="color: #d4d4d4;"&gt;(&lt;/SPAN&gt;&lt;SPAN style="color: #9cdcfe;"&gt;layerUrl&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: #9cdcfe;"&gt;mode:&lt;/SPAN&gt;&lt;SPAN style="color: #d4d4d4;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #9cdcfe;"&gt;FeatureLayer&lt;/SPAN&gt;&lt;SPAN style="color: #d4d4d4;"&gt;.&lt;/SPAN&gt;&lt;SPAN style="color: #9cdcfe;"&gt;MODE_SNAPSHOT&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: #9cdcfe;"&gt;outFields:&lt;/SPAN&gt;&lt;SPAN style="color: #d4d4d4;"&gt; [&lt;/SPAN&gt;&lt;SPAN style="color: #9cdcfe;"&gt;field&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: #9cdcfe;"&gt;id:&lt;/SPAN&gt;&lt;SPAN style="color: #d4d4d4;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #9cdcfe;"&gt;OverLayerID&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: #9cdcfe;"&gt;showAttribution:&lt;/SPAN&gt;&lt;SPAN style="color: #d4d4d4;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #569cd6;"&gt;false&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN style="color: #d4d4d4;"&gt; });&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;DIV style="background-color: #1e1e1e; font-weight: normal;"&gt;&lt;DIV&gt;&lt;SPAN style="color: #9cdcfe;"&gt;featureLayer&lt;/SPAN&gt;&lt;SPAN&gt;.&lt;/SPAN&gt;&lt;SPAN style="color: #dcdcaa;"&gt;setRenderer&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN style="color: #9cdcfe;"&gt;renderer&lt;/SPAN&gt;&lt;SPAN&gt;);&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;DIV style="background-color: #1e1e1e; font-weight: normal;"&gt;&lt;DIV&gt;&lt;SPAN style="color: #9cdcfe;"&gt;featureLayer&lt;/SPAN&gt;&lt;SPAN&gt;.&lt;/SPAN&gt;&lt;SPAN style="color: #dcdcaa;"&gt;setDefinitionExpression&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN style="color: #9cdcfe;"&gt;expr&lt;/SPAN&gt;&lt;SPAN&gt;);&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;DIV style="background-color: #1e1e1e; font-weight: normal;"&gt;&lt;DIV style="background-color: #1e1e1e; font-weight: normal;"&gt;&lt;DIV&gt;&lt;SPAN style="color: #9cdcfe;"&gt;featureLayer&lt;/SPAN&gt;&lt;SPAN&gt;.&lt;/SPAN&gt;&lt;SPAN style="color: #dcdcaa;"&gt;setInputGeometry&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN style="color: #9cdcfe;"&gt;geometry&lt;/SPAN&gt;&lt;SPAN&gt;);&amp;nbsp;&lt;/SPAN&gt;&amp;lt;------&amp;nbsp; something like this would be perfect&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;DIV style="background-color: #1e1e1e; font-weight: normal;"&gt;&lt;DIV&gt;&lt;SPAN style="color: #569cd6;"&gt;this&lt;/SPAN&gt;&lt;SPAN&gt;.&lt;/SPAN&gt;&lt;SPAN style="color: #9cdcfe;"&gt;map&lt;/SPAN&gt;&lt;SPAN&gt;.&lt;/SPAN&gt;&lt;SPAN style="color: #dcdcaa;"&gt;addLayer&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN style="color: #9cdcfe;"&gt;featureLayer&lt;/SPAN&gt;&lt;SPAN&gt;);&lt;/SPAN&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;DIV&gt; &lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The featurelayer definition expression and input geometry can be updated on the fly as the user interacts with the widget.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Any suggestions would be appreciated.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;P&gt;Mike.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 28 Mar 2018 10:09:07 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-web-appbuilder-questions/can-i-filter-a-featurelayer-by-a-custom-geometry/m-p/612809#M16196</guid>
      <dc:creator>deleted-user-RhG9zFDAFTI1</dc:creator>
      <dc:date>2018-03-28T10:09:07Z</dc:date>
    </item>
    <item>
      <title>Re: Can I filter a FeatureLayer by a custom geometry</title>
      <link>https://community.esri.com/t5/arcgis-web-appbuilder-questions/can-i-filter-a-featurelayer-by-a-custom-geometry/m-p/612810#M16197</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Mike,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp;Your workflow should be do a &lt;A href="https://developers.arcgis.com/javascript/3/jsapi/featurelayer-amd.html#queryids"&gt;queryIds&lt;/A&gt;&amp;nbsp;on the FeatureLayer to get the ids that the geometry intersect with and then&amp;nbsp;use the FeatureLayers &lt;A href="https://developers.arcgis.com/javascript/3/jsapi/featurelayer-amd.html#setdefinitionexpression"&gt;setDefinitionExpression&lt;/A&gt;&amp;nbsp;using a sql statement like ObjectID IN (your results from the Ids query array.join()).&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 28 Mar 2018 13:38:11 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-web-appbuilder-questions/can-i-filter-a-featurelayer-by-a-custom-geometry/m-p/612810#M16197</guid>
      <dc:creator>RobertScheitlin__GISP</dc:creator>
      <dc:date>2018-03-28T13:38:11Z</dc:date>
    </item>
    <item>
      <title>Re: Can I filter a FeatureLayer by a custom geometry</title>
      <link>https://community.esri.com/t5/arcgis-web-appbuilder-questions/can-i-filter-a-featurelayer-by-a-custom-geometry/m-p/612811#M16198</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Robert,&lt;/P&gt;&lt;P&gt;&amp;nbsp; Thanks for getting back to me. The feature layer that they are doing their selection on has many thousands of features that are densely packed. Is there a limit to the length of the definition expression that I can use, as&amp;nbsp;the number of selected features have the potential to be quite large.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 29 Mar 2018 00:18:26 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-web-appbuilder-questions/can-i-filter-a-featurelayer-by-a-custom-geometry/m-p/612811#M16198</guid>
      <dc:creator>deleted-user-RhG9zFDAFTI1</dc:creator>
      <dc:date>2018-03-29T00:18:26Z</dc:date>
    </item>
    <item>
      <title>Re: Can I filter a FeatureLayer by a custom geometry</title>
      <link>https://community.esri.com/t5/arcgis-web-appbuilder-questions/can-i-filter-a-featurelayer-by-a-custom-geometry/m-p/612812#M16199</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Mike,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp;That is exactly the situation that the SQL Syntax ObjectID IN (x,y,z) is capable of handling.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 29 Mar 2018 12:58:22 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-web-appbuilder-questions/can-i-filter-a-featurelayer-by-a-custom-geometry/m-p/612812#M16199</guid>
      <dc:creator>RobertScheitlin__GISP</dc:creator>
      <dc:date>2018-03-29T12:58:22Z</dc:date>
    </item>
  </channel>
</rss>

