<?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 Querying a feature layer in ArcGIS JavaScript Maps SDK Questions</title>
    <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/querying-a-feature-layer/m-p/363739#M33757</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hey guys, I am trying to filter out the geometries in a feature layer using a select box.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In c# you could just do a query on a layer then use the function featureLayerName.Update(); to refresh.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In javascript, I have something like this&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;query.where = "argument"&lt;/P&gt;&lt;P&gt;featureLayerName.selectFeatures(query, FeatureLayer.MODE_SNAPSHOT, function(results){&lt;/P&gt;&lt;P&gt;&amp;nbsp; featureLayerName.refresh();&lt;/P&gt;&lt;P&gt;});&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I did a queryCount and it returned the correct count, which tells me the query is working just fine. so I must be doing something wrong after I get the results.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;heres a fiddle&lt;/P&gt;&lt;P&gt;the code in question is in the councilFilter() function.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 13 Jan 2015 17:50:13 GMT</pubDate>
    <dc:creator>IbrahimHussein</dc:creator>
    <dc:date>2015-01-13T17:50:13Z</dc:date>
    <item>
      <title>Querying a feature layer</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/querying-a-feature-layer/m-p/363739#M33757</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hey guys, I am trying to filter out the geometries in a feature layer using a select box.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In c# you could just do a query on a layer then use the function featureLayerName.Update(); to refresh.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In javascript, I have something like this&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;query.where = "argument"&lt;/P&gt;&lt;P&gt;featureLayerName.selectFeatures(query, FeatureLayer.MODE_SNAPSHOT, function(results){&lt;/P&gt;&lt;P&gt;&amp;nbsp; featureLayerName.refresh();&lt;/P&gt;&lt;P&gt;});&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I did a queryCount and it returned the correct count, which tells me the query is working just fine. so I must be doing something wrong after I get the results.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;heres a fiddle&lt;/P&gt;&lt;P&gt;the code in question is in the councilFilter() function.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 13 Jan 2015 17:50:13 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/querying-a-feature-layer/m-p/363739#M33757</guid>
      <dc:creator>IbrahimHussein</dc:creator>
      <dc:date>2015-01-13T17:50:13Z</dc:date>
    </item>
    <item>
      <title>Re: Querying a feature layer</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/querying-a-feature-layer/m-p/363740#M33758</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Ibrahim,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; You need to set a selection symbol for the councilDistrictLayer.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; var selectionSymbol = new SimpleFillSymbol().setColor(new Color([255,255,0,0.5]));
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; councilDistrictLayer.setSelectionSymbol(selectionSymbol);&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Dec 2021 16:57:08 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/querying-a-feature-layer/m-p/363740#M33758</guid>
      <dc:creator>RobertScheitlin__GISP</dc:creator>
      <dc:date>2021-12-11T16:57:08Z</dc:date>
    </item>
    <item>
      <title>Re: Querying a feature layer</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/querying-a-feature-layer/m-p/363741#M33759</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks for the reply, I did do that earlier but that what I'm trying to do is only show the selected geometry. &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 13 Jan 2015 19:05:01 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/querying-a-feature-layer/m-p/363741#M33759</guid>
      <dc:creator>IbrahimHussein</dc:creator>
      <dc:date>2015-01-13T19:05:01Z</dc:date>
    </item>
    <item>
      <title>Re: Querying a feature layer</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/querying-a-feature-layer/m-p/363742#M33760</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Ok, what I did was &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;OL class="dp-c" start="1" style="font-size: 12px; font-family: Consolas, 'Courier New', Courier, mono, serif; list-style-position: initial; list-style-image: initial; color: #5c5c5c; margin-bottom: 1px !important; margin-left: 45px !important;"&gt;&lt;LI&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit; color: black; font-size: 9pt !important; background-color: inherit;"&gt;&lt;SPAN class="keyword" style="font-weight: inherit; font-style: inherit; color: #006699; font-size: 9pt !important; background-color: inherit;"&gt;var&lt;/SPAN&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit; font-size: 9pt !important; background-color: inherit;"&gt; selectionSymbol = &lt;/SPAN&gt;&lt;SPAN class="keyword" style="font-weight: inherit; font-style: inherit; color: #006699; font-size: 9pt !important; background-color: inherit;"&gt;new&lt;/SPAN&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit; font-size: 9pt !important; background-color: inherit;"&gt; SimpleFillSymbol().setColor(&lt;/SPAN&gt;&lt;SPAN class="keyword" style="font-weight: inherit; font-style: inherit; color: #006699; font-size: 9pt !important; background-color: inherit;"&gt;new&lt;/SPAN&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit; font-size: 9pt !important; background-color: inherit;"&gt; Color([&lt;/SPAN&gt;&lt;SPAN class="number" style="font-weight: inherit; font-style: inherit; color: green; font-size: 9pt !important; background-color: inherit;"&gt;0&lt;/SPAN&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit; font-size: 9pt !important; background-color: inherit;"&gt;,&lt;/SPAN&gt;&lt;SPAN class="number" style="font-weight: inherit; font-style: inherit; color: green; font-size: 9pt !important; background-color: inherit;"&gt;0&lt;/SPAN&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit; font-size: 9pt !important; background-color: inherit;"&gt;,&lt;/SPAN&gt;&lt;SPAN class="number" style="font-weight: inherit; font-style: inherit; color: green; font-size: 9pt !important; background-color: inherit;"&gt;0&lt;/SPAN&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit; font-size: 9pt !important; background-color: inherit;"&gt;,&lt;/SPAN&gt;&lt;SPAN class="number" style="font-weight: inherit; font-style: inherit; color: green; font-size: 9pt !important; background-color: inherit;"&gt;0&lt;/SPAN&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit; font-size: 9pt !important; background-color: inherit;"&gt;]));&amp;nbsp; &lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/LI&gt;&lt;LI&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit; color: black; font-size: 9pt !important; background-color: inherit;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; councilDistrictLayer.setSelectionSymbol(selectionSymbol);&amp;nbsp; &lt;/SPAN&gt;&lt;/LI&gt;&lt;/OL&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit; color: black; font-size: 9pt !important; background-color: inherit;"&gt;Like Robert suggested, but in the query I did a &amp;lt;&amp;gt; (not equal) that way it selects all others and turns the alpha to 0.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #000000; background-color: inherit;"&gt;&lt;SPAN style="font-size: 9pt !important; font-style: inherit; font-weight: inherit;"&gt;Im sure there is a better way to do it, but in case anyone comes across the same issue, &lt;/SPAN&gt;&lt;SPAN style="font-size: 12px; line-height: 18px;"&gt;that's&lt;/SPAN&gt;&lt;SPAN style="font-size: 9pt !important; font-style: inherit; font-weight: inherit;"&gt; how I did it. &lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 13 Jan 2015 19:10:08 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/querying-a-feature-layer/m-p/363742#M33760</guid>
      <dc:creator>IbrahimHussein</dc:creator>
      <dc:date>2015-01-13T19:10:08Z</dc:date>
    </item>
    <item>
      <title>Re: Querying a feature layer</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/querying-a-feature-layer/m-p/363743#M33761</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Ibrahim,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; If you only want to show the selected district then do not do a selection at all and just set the layers definition query&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Here is a updated &lt;A href="http://jsfiddle.net/rscheitlin/hg8udgtq/"&gt;JSFiddle&lt;/A&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 13 Jan 2015 20:36:22 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/querying-a-feature-layer/m-p/363743#M33761</guid>
      <dc:creator>RobertScheitlin__GISP</dc:creator>
      <dc:date>2015-01-13T20:36:22Z</dc:date>
    </item>
    <item>
      <title>Re: Querying a feature layer</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/querying-a-feature-layer/m-p/363744#M33762</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I knew there was some function I missed, thanks for all the help robert.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 13 Jan 2015 20:41:08 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/querying-a-feature-layer/m-p/363744#M33762</guid>
      <dc:creator>IbrahimHussein</dc:creator>
      <dc:date>2015-01-13T20:41:08Z</dc:date>
    </item>
  </channel>
</rss>

