<?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 on FeatureLayer in ArcGIS JavaScript Maps SDK Questions</title>
    <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/highlight-on-featurelayer/m-p/1096684#M74618</link>
    <description>&lt;P&gt;Hi everyone into Community.&lt;BR /&gt;&lt;BR /&gt;I have an Angular application where I load portalID item derivede from DXF file as FeatureLayer and I highlight layer polygons according to selection.&lt;/P&gt;&lt;P&gt;I woud like to dinamically change color before highlighting the resulting feature, but setting it in highlightOptions of the mapView doesn't affet the result.&lt;/P&gt;&lt;P&gt;The following is the code I wrote:&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;public highlight(filter: string) {
    console.log(this.mapView.highlightOptions.color);
    this.mapView.highlightOptions.color = new Color('green');
    console.log(this.mapView.highlightOptions.color);
    this.mapView.whenLayerView(this.featureLayer).then((layerView) =&amp;gt; {
      const query: Query = new Query();
      query.returnGeometry = true;
      query.outFields = ['*'];
      query.where = "Text='" + filter + "'";
      this.featureLayer.queryFeatures(query).then((result) =&amp;gt; {
        if (this.highlightState) {
          this.highlightState.remove();
        }
        console.log(this.mapView.highlightOptions.color);
        this.highlightState = layerView.highlight(result.features) as Handle;
      });
    });
  }&lt;/LI-CODE&gt;&lt;P&gt;As you can see, I added console.log instruction to check the setting when I call the function and I try to change its value: during execution when I enter first time into the function I see that setting is initialized as made in mapView definition (RED), it's correctly modified to GREEN, but the highlight item is always shown in RED.&lt;BR /&gt;When I call again the function, the setting is GREEN from the beginning, but highlight is in RED.&lt;/P&gt;&lt;P&gt;May any of you explain what I'm doing wrong?&lt;BR /&gt;Thanks in advance, best regards.&lt;/P&gt;</description>
    <pubDate>Thu, 09 Sep 2021 10:23:17 GMT</pubDate>
    <dc:creator>PaoloF</dc:creator>
    <dc:date>2021-09-09T10:23:17Z</dc:date>
    <item>
      <title>Highlight on FeatureLayer</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/highlight-on-featurelayer/m-p/1096684#M74618</link>
      <description>&lt;P&gt;Hi everyone into Community.&lt;BR /&gt;&lt;BR /&gt;I have an Angular application where I load portalID item derivede from DXF file as FeatureLayer and I highlight layer polygons according to selection.&lt;/P&gt;&lt;P&gt;I woud like to dinamically change color before highlighting the resulting feature, but setting it in highlightOptions of the mapView doesn't affet the result.&lt;/P&gt;&lt;P&gt;The following is the code I wrote:&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;public highlight(filter: string) {
    console.log(this.mapView.highlightOptions.color);
    this.mapView.highlightOptions.color = new Color('green');
    console.log(this.mapView.highlightOptions.color);
    this.mapView.whenLayerView(this.featureLayer).then((layerView) =&amp;gt; {
      const query: Query = new Query();
      query.returnGeometry = true;
      query.outFields = ['*'];
      query.where = "Text='" + filter + "'";
      this.featureLayer.queryFeatures(query).then((result) =&amp;gt; {
        if (this.highlightState) {
          this.highlightState.remove();
        }
        console.log(this.mapView.highlightOptions.color);
        this.highlightState = layerView.highlight(result.features) as Handle;
      });
    });
  }&lt;/LI-CODE&gt;&lt;P&gt;As you can see, I added console.log instruction to check the setting when I call the function and I try to change its value: during execution when I enter first time into the function I see that setting is initialized as made in mapView definition (RED), it's correctly modified to GREEN, but the highlight item is always shown in RED.&lt;BR /&gt;When I call again the function, the setting is GREEN from the beginning, but highlight is in RED.&lt;/P&gt;&lt;P&gt;May any of you explain what I'm doing wrong?&lt;BR /&gt;Thanks in advance, best regards.&lt;/P&gt;</description>
      <pubDate>Thu, 09 Sep 2021 10:23:17 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/highlight-on-featurelayer/m-p/1096684#M74618</guid>
      <dc:creator>PaoloF</dc:creator>
      <dc:date>2021-09-09T10:23:17Z</dc:date>
    </item>
    <item>
      <title>Re: Highlight on FeatureLayer</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/highlight-on-featurelayer/m-p/1096723#M74622</link>
      <description>&lt;P&gt;Hi everyone.&lt;BR /&gt;&lt;BR /&gt;I solved by myself the issue I post this morning in following way:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;this.mapView.set('highlightOptions', { color });&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;where color is a string variable containing the color I desire to show.&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 09 Sep 2021 14:01:39 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/highlight-on-featurelayer/m-p/1096723#M74622</guid>
      <dc:creator>PaoloF</dc:creator>
      <dc:date>2021-09-09T14:01:39Z</dc:date>
    </item>
  </channel>
</rss>

