<?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: Re-symbolized layer not updating on the map experience builder in ArcGIS Experience Builder Questions</title>
    <link>https://community.esri.com/t5/arcgis-experience-builder-questions/re-symbolized-layer-not-updating-on-the-map/m-p/1163136#M4139</link>
    <description>&lt;P&gt;This works perfectly. Thank you!&lt;/P&gt;</description>
    <pubDate>Mon, 11 Apr 2022 17:38:23 GMT</pubDate>
    <dc:creator>KisakyeM</dc:creator>
    <dc:date>2022-04-11T17:38:23Z</dc:date>
    <item>
      <title>Re-symbolized layer not updating on the map experience builder</title>
      <link>https://community.esri.com/t5/arcgis-experience-builder-questions/re-symbolized-layer-not-updating-on-the-map/m-p/1161345#M4086</link>
      <description>&lt;P&gt;I have code that allows a user to select a field from a dropdown menu and re-symbolize the layer (previously set up in settings) based on the selected field. When I set the renderer using the selected field however, I can tell on the console that the renderer has been updated, but the map does not update with the newly set symbology. What am I missing?&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;/** @jsx jsx */
import {
  React, AllWidgetProps, jsx, DataSourceComponent,
  SqlQueryParams, DataSourceManager, QueriableDataSource,
  DataSource
} from "jimu-core";
import { JimuMapViewComponent, JimuMapView, FeatureLayerDataSource } from "jimu-arcgis";
import Point from "esri/geometry/Point";
import { Button, Dropdown, DropdownButton, DropdownMenu } from 'jimu-ui'
export default class Widget extends React.PureComponent&amp;lt;AllWidgetProps&amp;lt;any&amp;gt;, any&amp;gt;
{
  constructor(props) {
    super(props);
    this.state = {
      allFields: [],
      lyr:null
    }
  }
  OnSelectedFieldChanged = e =&amp;gt; {
    const myfield = e.target.value;

    const fwySym = {
      type: "simple-line", // autocasts as new SimpleLineSymbol()
      color: "#30ffea",
      width: "0.5px",
      style: "solid"
    };

    const hwySym = {
      type: "simple-line", // autocasts as new SimpleLineSymbol()
      color: "#ff6207",
      width: "0.5px",
      style: "solid"
    };

    const otherSym = {
      type: "simple-line", // autocasts as new SimpleLineSymbol()
      color: "#ef37ac",
      width: "0.5px",
      style: "solid"
    };

    const myRend =
    {
      type: "unique-value", // autocasts as new UniqueValueRenderer()
      legendOptions: {
        title: "Freeway type"
      },
      defaultSymbol: otherSym,
      defaultLabel: "State Highway",
      field: myfield,
      uniqueValueInfos: [
        {
          value: "YES", 
          symbol: fwySym,
          label: "Interstate"
        },
        {
          value: "NO", 
          symbol: hwySym,
          label: "US Highway"
        }
      ]
    };

    this.state.lyr.renderer=myRend;
    this.state.lyr.refresh();
    console.log(this.state.lyr);
  }

  onDataSourceCreated = (ds: DataSource) =&amp;gt; {
    const datasrc=this.props.useDataSources[0]
    const myDs = DataSourceManager.getInstance().getDataSource(datasrc.dataSourceId) as FeatureLayerDataSource
    const fl = myDs.layer
    this.setState({ allFields: fl.fields, lyr: fl })    
  }
  
  render() {
    return &amp;lt;div className="widget-starter jimu-widget"&amp;gt;
      &amp;lt;DataSourceComponent
        useDataSource={this.props.useDataSources[0]}
        widgetId={this.props.id}
        onDataSourceCreated={this.onDataSourceCreated}
      /&amp;gt;
      {console.log(this.state.lyr)}
      {this.state.allFields.length &amp;gt; 0 &amp;amp;&amp;amp;
        &amp;lt;select onChange={this.OnSelectedFieldChanged}&amp;gt;
          &amp;lt;option value="Select a field"&amp;gt;-- select a field --&amp;lt;/option&amp;gt;
          {this.state.allFields.map((field) =&amp;gt; &amp;lt;option key={field.alias} value={field.name}&amp;gt;{field.alias}&amp;lt;/option&amp;gt;)}
        &amp;lt;/select&amp;gt;}
    &amp;lt;/div&amp;gt;
  }
}&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;A href="https://community.esri.com/t5/user/viewprofilepage/user-id/124928" target="_blank" rel="noopener"&gt;@Jianxia&lt;/A&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;A href="https://community.esri.com/t5/user/viewprofilepage/user-id/320" target="_blank" rel="noopener"&gt;@GavinRehkemper&lt;/A&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;A href="https://community.esri.com/t5/user/viewprofilepage/user-id/469014" target="_blank" rel="noopener"&gt;@milesleeaus&lt;/A&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;A href="https://community.esri.com/t5/user/viewprofilepage/user-id/236124" target="_blank" rel="noopener"&gt;@EmilieRabeau&lt;/A&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;A href="https://community.esri.com/t5/user/viewprofilepage/user-id/974" target="_blank" rel="noopener"&gt;@PatrickHuls_SpatialNinja&lt;/A&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;A href="https://community.esri.com/t5/user/viewprofilepage/user-id/4655" target="_blank" rel="noopener"&gt;@TonghuiMing&lt;/A&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;A href="https://community.esri.com/t5/user/viewprofilepage/user-id/363906" target="_blank" rel="noopener"&gt;@jcarlson&lt;/A&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;A href="https://community.esri.com/t5/user/viewprofilepage/user-id/2839" target="_blank" rel="noopener"&gt;@KenBuja&lt;/A&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;A href="https://community.esri.com/t5/user/viewprofilepage/user-id/15530" target="_blank" rel="noopener"&gt;@RhettZufelt&lt;/A&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;A href="https://community.esri.com/t5/user/viewprofilepage/user-id/54255" target="_blank" rel="noopener"&gt;@ShengdiZhang&lt;/A&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;A href="https://community.esri.com/t5/user/viewprofilepage/user-id/109662" target="_blank" rel="noopener"&gt;@ZhifangWang&lt;/A&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;A href="https://community.esri.com/t5/user/viewprofilepage/user-id/36532" target="_blank" rel="noopener"&gt;@DaveFullerton&lt;/A&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;A href="https://community.esri.com/t5/user/viewprofilepage/user-id/123963" target="_blank" rel="noopener"&gt;@DavidMartinez&lt;/A&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 05 Apr 2022 19:47:01 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-experience-builder-questions/re-symbolized-layer-not-updating-on-the-map/m-p/1161345#M4086</guid>
      <dc:creator>KisakyeM</dc:creator>
      <dc:date>2022-04-05T19:47:01Z</dc:date>
    </item>
    <item>
      <title>Re: Re-symbolized layer not updating on the map experience builder</title>
      <link>https://community.esri.com/t5/arcgis-experience-builder-questions/re-symbolized-layer-not-updating-on-the-map/m-p/1162864#M4128</link>
      <description>&lt;P&gt;Hi KisakyeM,&lt;/P&gt;&lt;P&gt;Please find my modified codes which I think it's solved, noted that you have to modify both setting.tsx and widget.tsx and then select data source and map object.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sun, 10 Apr 2022 06:33:08 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-experience-builder-questions/re-symbolized-layer-not-updating-on-the-map/m-p/1162864#M4128</guid>
      <dc:creator>mileslee_esri</dc:creator>
      <dc:date>2022-04-10T06:33:08Z</dc:date>
    </item>
    <item>
      <title>Re: Re-symbolized layer not updating on the map experience builder</title>
      <link>https://community.esri.com/t5/arcgis-experience-builder-questions/re-symbolized-layer-not-updating-on-the-map/m-p/1163136#M4139</link>
      <description>&lt;P&gt;This works perfectly. Thank you!&lt;/P&gt;</description>
      <pubDate>Mon, 11 Apr 2022 17:38:23 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-experience-builder-questions/re-symbolized-layer-not-updating-on-the-map/m-p/1163136#M4139</guid>
      <dc:creator>KisakyeM</dc:creator>
      <dc:date>2022-04-11T17:38:23Z</dc:date>
    </item>
  </channel>
</rss>

