<?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 Highlight features from map.allLayers in ArcGIS JavaScript Maps SDK Questions</title>
    <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/highlight-features-from-map-alllayers/m-p/1252268#M80071</link>
    <description>&lt;P&gt;Hi folks,&lt;/P&gt;&lt;P&gt;I am selecting features from all layers on my map and now i want to highlight all selected features. I do it using this code:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;let highlight;
map.allLayers.forEach(layer =&amp;gt; {
            // Query all layers data
              if (layer.type === "feature" &amp;amp;&amp;amp; layer.visible){
                        layer.queryFeatures(query)
                        .then((results) =&amp;gt; {
                          const graphics = results.features;
                          // console.log(graphics);
                            // do something with query results
                            highlight = highlight(graphics);
                     })   
                }
            });&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;But i get error:&amp;nbsp;&lt;STRONG&gt;&lt;FONT color="#FF0000"&gt;&lt;SPAN class=""&gt;&lt;SPAN class=""&gt;&lt;SPAN class=""&gt;Uncaught (in promise) &lt;SPAN class=""&gt;TypeError: &lt;SPAN class=""&gt;highlight is not a function;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;How can i simply achive this?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;</description>
    <pubDate>Fri, 27 Jan 2023 10:13:54 GMT</pubDate>
    <dc:creator>Vakhtang_Zubiashvili</dc:creator>
    <dc:date>2023-01-27T10:13:54Z</dc:date>
    <item>
      <title>Highlight features from map.allLayers</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/highlight-features-from-map-alllayers/m-p/1252268#M80071</link>
      <description>&lt;P&gt;Hi folks,&lt;/P&gt;&lt;P&gt;I am selecting features from all layers on my map and now i want to highlight all selected features. I do it using this code:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;let highlight;
map.allLayers.forEach(layer =&amp;gt; {
            // Query all layers data
              if (layer.type === "feature" &amp;amp;&amp;amp; layer.visible){
                        layer.queryFeatures(query)
                        .then((results) =&amp;gt; {
                          const graphics = results.features;
                          // console.log(graphics);
                            // do something with query results
                            highlight = highlight(graphics);
                     })   
                }
            });&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;But i get error:&amp;nbsp;&lt;STRONG&gt;&lt;FONT color="#FF0000"&gt;&lt;SPAN class=""&gt;&lt;SPAN class=""&gt;&lt;SPAN class=""&gt;Uncaught (in promise) &lt;SPAN class=""&gt;TypeError: &lt;SPAN class=""&gt;highlight is not a function;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;How can i simply achive this?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;</description>
      <pubDate>Fri, 27 Jan 2023 10:13:54 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/highlight-features-from-map-alllayers/m-p/1252268#M80071</guid>
      <dc:creator>Vakhtang_Zubiashvili</dc:creator>
      <dc:date>2023-01-27T10:13:54Z</dc:date>
    </item>
    <item>
      <title>Re: Highlight features from map.allLayers</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/highlight-features-from-map-alllayers/m-p/1252356#M80073</link>
      <description>&lt;P&gt;Highlight is a method on the LayerView, so you need a reference to the LayerView that your features come from.&lt;/P&gt;&lt;P&gt;&lt;A href="https://developers.arcgis.com/javascript/latest/api-reference/esri-views-layers-FeatureLayerView.html#highlight" target="_blank"&gt;https://developers.arcgis.com/javascript/latest/api-reference/esri-views-layers-FeatureLayerView.html#highlight&lt;/A&gt;&lt;/P&gt;&lt;P&gt;You get a reference to the LayerView for each layer using the view.whenLayerView method.&lt;/P&gt;&lt;P&gt;&lt;A href="https://developers.arcgis.com/javascript/latest/api-reference/esri-views-MapView.html#whenLayerView" target="_blank"&gt;https://developers.arcgis.com/javascript/latest/api-reference/esri-views-MapView.html#whenLayerView&lt;/A&gt;&lt;/P&gt;&lt;P&gt;Then you can use the layerView to highlight the features you are interested in.&lt;/P&gt;&lt;P&gt;Here is one of a few samples that show how to use highlight&lt;/P&gt;&lt;P&gt;&lt;A href="https://developers.arcgis.com/javascript/latest/sample-code/sandbox/?sample=widgets-feature-multiplelayers" target="_blank"&gt;https://developers.arcgis.com/javascript/latest/sample-code/sandbox/?sample=widgets-feature-multiplelayers&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 27 Jan 2023 14:54:32 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/highlight-features-from-map-alllayers/m-p/1252356#M80073</guid>
      <dc:creator>ReneRubalcava</dc:creator>
      <dc:date>2023-01-27T14:54:32Z</dc:date>
    </item>
    <item>
      <title>Re: Highlight features from map.allLayers</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/highlight-features-from-map-alllayers/m-p/1256064#M80193</link>
      <description>&lt;P&gt;Thank you&amp;nbsp;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/7384"&gt;@ReneRubalcava&lt;/a&gt;&amp;nbsp;, you helped me, awesome!&lt;/P&gt;</description>
      <pubDate>Wed, 08 Feb 2023 11:14:47 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/highlight-features-from-map-alllayers/m-p/1256064#M80193</guid>
      <dc:creator>Vakhtang_Zubiashvili</dc:creator>
      <dc:date>2023-02-08T11:14:47Z</dc:date>
    </item>
  </channel>
</rss>

