<?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: FeatureLayer.selectFeatures() in JSAPI 3.x in Web AppBuilder Custom Widgets Questions</title>
    <link>https://community.esri.com/t5/web-appbuilder-custom-widgets-questions/featurelayer-selectfeatures-in-jsapi-3-x/m-p/786453#M3647</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Arne,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp;Try using &lt;A href="https://developers.arcgis.com/javascript/3/jsapi/esri.geometry.webmercatorutils-amd.html"&gt;WebMercatorUtils&lt;/A&gt;&amp;nbsp;geographicToWebMercator method to change the inputBuffer polygon from wkid 4326 to 102100&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 10 Sep 2020 16:50:33 GMT</pubDate>
    <dc:creator>RobertScheitlin__GISP</dc:creator>
    <dc:date>2020-09-10T16:50:33Z</dc:date>
    <item>
      <title>FeatureLayer.selectFeatures() in JSAPI 3.x</title>
      <link>https://community.esri.com/t5/web-appbuilder-custom-widgets-questions/featurelayer-selectfeatures-in-jsapi-3-x/m-p/786449#M3643</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Working on a custom WAB widget (JSAPI 3.x) that generates some buffers around user selected&amp;nbsp;input features. Wanting to highlight&amp;nbsp;features found within buffer on the map.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The following code (amalgamated from various online examples) finds the features&amp;nbsp;but it won't highlight anything in the map:&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&lt;CODE&gt;&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;
bufferQuery &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; &lt;SPAN class="keyword token"&gt;new&lt;/SPAN&gt; &lt;SPAN class="token class-name"&gt;Query&lt;/SPAN&gt;&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;
bufferQuery&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;returnGeometry &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; &lt;SPAN class="keyword token"&gt;true&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt;
bufferQuery&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;where &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;"1=1"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt;
bufferQuery&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;outFields &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; &lt;SPAN class="punctuation token"&gt;[&lt;/SPAN&gt;&lt;SPAN class="string token"&gt;"*"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;]&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt;
bufferQuery&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;SpatialRelationship &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;"SPATIAL_REL_CONTAINS"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt; 
bufferQuery&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;geometry &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; inputBuffer&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="punctuation token"&gt;.&lt;/SPAN&gt;

&lt;SPAN class="keyword token"&gt;var&lt;/SPAN&gt; selectionSymbol &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; &lt;SPAN class="keyword token"&gt;new&lt;/SPAN&gt; &lt;SPAN class="token class-name"&gt;SimpleMarkerSymbol&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;
    SimpleMarkerSymbol&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;STYLE_CIRCLE&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; 
    &lt;SPAN class="number token"&gt;12&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; 
    &lt;SPAN class="keyword token"&gt;new&lt;/SPAN&gt; &lt;SPAN class="token class-name"&gt;SimpleLineSymbol&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;
        SimpleLineSymbol&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;STYLE_NULL&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; 
        &lt;SPAN class="keyword token"&gt;new&lt;/SPAN&gt; &lt;SPAN class="token class-name"&gt;Color&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;[&lt;/SPAN&gt;&lt;SPAN class="number token"&gt;247&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; &lt;SPAN class="number token"&gt;34&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; &lt;SPAN class="number token"&gt;101&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; &lt;SPAN class="number token"&gt;0.9&lt;/SPAN&gt;&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="number token"&gt;1&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;new&lt;/SPAN&gt; &lt;SPAN class="token class-name"&gt;Color&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;[&lt;/SPAN&gt;&lt;SPAN class="number token"&gt;207&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; &lt;SPAN class="number token"&gt;34&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; &lt;SPAN class="number token"&gt;171&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; &lt;SPAN class="number token"&gt;0.5&lt;/SPAN&gt;&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="punctuation token"&gt;;&lt;/SPAN&gt;


myFeatureLayer&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;&lt;SPAN class="token function"&gt;setSelectionSymbol&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;selectionSymbol&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt; 
myFeatureLayer&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;&lt;SPAN class="token function"&gt;selectFeatures&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;bufferQuery&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; FeatureLayer&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;SELECTION_NEW&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; &lt;SPAN class="keyword token"&gt;function&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;results&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt; &lt;SPAN class="punctuation token"&gt;{&lt;/SPAN&gt;
            console&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;&lt;SPAN class="token function"&gt;log&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="string token"&gt;"found "&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; results&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;length&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;" features in buffer"&lt;/SPAN&gt;&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="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;/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;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;I've played around with taking each taking and making a&amp;nbsp;new Graphic from it to then add to a graphics layers but my&amp;nbsp;understanding from&amp;nbsp; what I read was that the above or some variation thereof should highlight the selection using the specific symbology. Something missing?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 12 Dec 2021 08:58:16 GMT</pubDate>
      <guid>https://community.esri.com/t5/web-appbuilder-custom-widgets-questions/featurelayer-selectfeatures-in-jsapi-3-x/m-p/786449#M3643</guid>
      <dc:creator>Arne_Gelfert</dc:creator>
      <dc:date>2021-12-12T08:58:16Z</dc:date>
    </item>
    <item>
      <title>Re: FeatureLayer.selectFeatures() in JSAPI 3.x</title>
      <link>https://community.esri.com/t5/web-appbuilder-custom-widgets-questions/featurelayer-selectfeatures-in-jsapi-3-x/m-p/786450#M3644</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Arne,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp;The code should work if the feature you are attempting to select is a point layer, depending on the spatial reference of the buffer being the same as the layer you are attempting to select.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 09 Sep 2020 18:48:50 GMT</pubDate>
      <guid>https://community.esri.com/t5/web-appbuilder-custom-widgets-questions/featurelayer-selectfeatures-in-jsapi-3-x/m-p/786450#M3644</guid>
      <dc:creator>RobertScheitlin__GISP</dc:creator>
      <dc:date>2020-09-09T18:48:50Z</dc:date>
    </item>
    <item>
      <title>Re: FeatureLayer.selectFeatures() in JSAPI 3.x</title>
      <link>https://community.esri.com/t5/web-appbuilder-custom-widgets-questions/featurelayer-selectfeatures-in-jsapi-3-x/m-p/786451#M3645</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;That's what I thought but you bring up a good point - I ran into an issue with Linear/Angular spatial reference earlier. So maybe I'm mixing spatial reference. I'll take a look at that -thanks, Robert!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 09 Sep 2020 19:28:31 GMT</pubDate>
      <guid>https://community.esri.com/t5/web-appbuilder-custom-widgets-questions/featurelayer-selectfeatures-in-jsapi-3-x/m-p/786451#M3645</guid>
      <dc:creator>Arne_Gelfert</dc:creator>
      <dc:date>2020-09-09T19:28:31Z</dc:date>
    </item>
    <item>
      <title>Re: FeatureLayer.selectFeatures() in JSAPI 3.x</title>
      <link>https://community.esri.com/t5/web-appbuilder-custom-widgets-questions/featurelayer-selectfeatures-in-jsapi-3-x/m-p/786452#M3646</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;A href="https://community.esri.com/migrated-users/3101"&gt;Robert Scheitlin, GISP&lt;/A&gt;&amp;nbsp;- So the deeper I git here, the more confused I get. Looking at spatial references, it's clear that the features found in the buffers are WKID 4326 don't have the same WKID as the&amp;nbsp;map, which is 102100, although they come from a map services that has the map's&amp;nbsp;SR.&amp;nbsp;Not sure why.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Anyway,&amp;nbsp;so I add the below line, which&amp;nbsp;fixes the WKID for what's returned...&lt;/P&gt;&lt;PRE class="language-javascript line-numbers"&gt;&lt;CODE&gt;bufferQuery&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;outSpatialReference &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; &lt;SPAN class="keyword token"&gt;this&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;map&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;spatialReference&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;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;But that doesn't put anything on the map.&lt;/P&gt;&lt;P&gt;The buffer&amp;nbsp;that I'm&amp;nbsp;creating&amp;nbsp;with the following snippet also has WKID 4326&amp;nbsp;...&lt;/P&gt;&lt;PRE class="language-none line-numbers"&gt;&lt;CODE&gt;inputBuffer = GeometryEngine.geodesicBuffer(myCtrPnt,[1000],"feet",true);&lt;SPAN class="line-numbers-rows"&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;... my understanding was that geodesicBuffer would handle either of WGS84 and Web Mercator. I don't see a way to put any params into GeometryEngine like some of the GeometryService examples show. Is that what's needed here?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 10 Sep 2020 16:19:36 GMT</pubDate>
      <guid>https://community.esri.com/t5/web-appbuilder-custom-widgets-questions/featurelayer-selectfeatures-in-jsapi-3-x/m-p/786452#M3646</guid>
      <dc:creator>Arne_Gelfert</dc:creator>
      <dc:date>2020-09-10T16:19:36Z</dc:date>
    </item>
    <item>
      <title>Re: FeatureLayer.selectFeatures() in JSAPI 3.x</title>
      <link>https://community.esri.com/t5/web-appbuilder-custom-widgets-questions/featurelayer-selectfeatures-in-jsapi-3-x/m-p/786453#M3647</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Arne,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp;Try using &lt;A href="https://developers.arcgis.com/javascript/3/jsapi/esri.geometry.webmercatorutils-amd.html"&gt;WebMercatorUtils&lt;/A&gt;&amp;nbsp;geographicToWebMercator method to change the inputBuffer polygon from wkid 4326 to 102100&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 10 Sep 2020 16:50:33 GMT</pubDate>
      <guid>https://community.esri.com/t5/web-appbuilder-custom-widgets-questions/featurelayer-selectfeatures-in-jsapi-3-x/m-p/786453#M3647</guid>
      <dc:creator>RobertScheitlin__GISP</dc:creator>
      <dc:date>2020-09-10T16:50:33Z</dc:date>
    </item>
    <item>
      <title>Re: FeatureLayer.selectFeatures() in JSAPI 3.x</title>
      <link>https://community.esri.com/t5/web-appbuilder-custom-widgets-questions/featurelayer-selectfeatures-in-jsapi-3-x/m-p/786454#M3648</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Cool, thanks, Your one-liners are like fresh batteries in the caverns of ESRI documentation. Haha.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Also. I just found that I may be complicating matters by&amp;nbsp;using the result from a Search (with suggestions) to get my buffer center point and that seems to default&amp;nbsp;to a WKID different from what's in my service. Not sure but I'm going to try to fix that it needed,.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 10 Sep 2020 16:59:15 GMT</pubDate>
      <guid>https://community.esri.com/t5/web-appbuilder-custom-widgets-questions/featurelayer-selectfeatures-in-jsapi-3-x/m-p/786454#M3648</guid>
      <dc:creator>Arne_Gelfert</dc:creator>
      <dc:date>2020-09-10T16:59:15Z</dc:date>
    </item>
    <item>
      <title>Re: FeatureLayer.selectFeatures() in JSAPI 3.x</title>
      <link>https://community.esri.com/t5/web-appbuilder-custom-widgets-questions/featurelayer-selectfeatures-in-jsapi-3-x/m-p/786455#M3649</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Never did get the selectFeatures() to work so I resorted to a work-around, simply&amp;nbsp;iterating over the features which&amp;nbsp;queryFeatures() would return and making them into Graphics one by one. Then adding them&amp;nbsp;to&lt;/P&gt;&lt;PRE class="language-javascript line-numbers"&gt;&lt;CODE&gt;map&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;graphics&lt;SPAN class="line-numbers-rows"&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;Seems these days that half the things i try to do don't work out the way that my interpretation of the documentation says it should. In the end,&amp;nbsp;what matters though are result and work-arounds do the job.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 17 Sep 2020 15:45:44 GMT</pubDate>
      <guid>https://community.esri.com/t5/web-appbuilder-custom-widgets-questions/featurelayer-selectfeatures-in-jsapi-3-x/m-p/786455#M3649</guid>
      <dc:creator>Arne_Gelfert</dc:creator>
      <dc:date>2020-09-17T15:45:44Z</dc:date>
    </item>
  </channel>
</rss>

