<?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: Editor widget only display defaultSymbol from UniqueValueRenderer in ArcGIS JavaScript Maps SDK Questions</title>
    <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/editor-widget-only-display-defaultsymbol-from/m-p/1300282#M81422</link>
    <description>&lt;P&gt;Thank you! its appear! u really save my time!&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Fri, 16 Jun 2023 16:18:40 GMT</pubDate>
    <dc:creator>msyazreen</dc:creator>
    <dc:date>2023-06-16T16:18:40Z</dc:date>
    <item>
      <title>Editor widget only display defaultSymbol from UniqueValueRenderer</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/editor-widget-only-display-defaultsymbol-from/m-p/1299531#M81403</link>
      <description>&lt;P&gt;&lt;SPAN&gt;Hi, I am new to community.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;I'm reaching out to the ArcGIS community for support regarding an issue I'm experiencing with the Editor widget (JS API 4.25) and FeatureLayer. I'm trying to use the Editor widget to display military symbols, which I have created using a third-party library, on FeatureLayer.&lt;/P&gt;&lt;P&gt;The problem is that while the symbols I created from a JSON file are displayed correctly on the layer but on Editor widget, only defaultSymbol is being displayed. I'm uncertain about how to interpret and resolve this issue. To provide some context, I have included a snippet of the relevant code below:&lt;BR /&gt;&lt;BR /&gt;Thanks in advance.&lt;/P&gt;&lt;P&gt;ps: please ignore lineLayerMilitary.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;var situation = {"name":"Layer","type":"FeatureCollection",
    "crs": {"type": "name","properties": {"name": "EPSG:4326"}},
    "features":[
      {"type":"Feature","geometry":{"type":"Point","coordinates":[13.9264527063343,56.2888907165595]},"properties":{"SIDC":"SFGPU------E***","name":"1.C2 komp","fullname":"1.C2 komp/FTS/INSS","command":"FTS"}}
      ,{"type":"Feature","geometry":{"type":"Point","coordinates":[19.1604869967705,65.5966818958909]},"properties":{"SIDC":"SFGPUCRV---F***","name":"1.Jbat","fullname":"1.Jbat/INSS","command":"INSS"}}
      ,{"type":"Feature","geometry":{"type":"Point","coordinates":[17.0825282191617,59.6410393541284]},"properties":{"SIDC":"SFGPUUMSE--F***","name":"1.TKbat","fullname":"1.TKbat/INSS","command":"INSS"}}]}

var unknown = new ms.Symbol("SFGPUUMSE--F***", { size: 15, square: true });
    var unknownUnit = new PictureMarkerSymbol({
      url: unknown.asCanvas(3).toDataURL(),
      width: Math.max(unknown.getSize().width),
      height: Math.max(unknown.getSize().height)
    });

    let uvrenderer = new UniqueValueRenderer({
      field: "name",
      defaultSymbol: unknownUnit
    });

var graphics = situation.features.map((feature, i) =&amp;gt; {
      var unit = new ms.Symbol(feature.properties.SIDC, { size: 15, square: true });
      var unitSymbol = new PictureMarkerSymbol({
        url: unit.asCanvas(3).toDataURL(),
        width: Math.max(unit.getSize().width),
        height: Math.max(unit.getSize().height)
      });
      uvrenderer.addUniqueValueInfo(feature.properties.name,unitSymbol)
      return {
        geometry: new Point({
          x: feature.geometry.coordinates[0],
          y: feature.geometry.coordinates[1]
        }),
        symbol: unitSymbol,
        attributes: {
          ObjectID: i,
          name: feature.properties.name,
          SIDC: feature.properties.SIDC,
        }
      };
    });

const pointLayerMilitary = new FeatureLayer({
      id:'pointLayerMilId',
      outFields: ["*"],
      templates : [{
        "name" : "Military",
        "prototype" : {
          "attributes" : {
            title:null
          }
      }}],
      source:graphics,
      visible:true,
      geometryType: "point",
      fields: [{name: "ObjectID",alias: "ObjectID",type: "oid"}
        ,{name: "name",alias: "Name",type: "string"}
        ,{name: "SIDC",alias: "SIDC",type: "string"}
        ,{name: "command",alias: "Command",type: "string"}],
      objectIdField: "ObjectID",
      renderer: uvrenderer
    });
this._view.map.add(pointLayerMilitary);

const layerInfos = [{layer: lineLayerMilitary,pointLayerMilitary}];

    const editorMil = new Editor({
      label:'Military Symbology',
      headingLevel:2,
      visibleElements: {snappingControls: false},
      viewModel: new EditorVM({
        layerInfos:layerInfos,
        featureTemplatesViewModel: new FeatureTemplatesVM({
          layers: [lineLayerMilitary,pointLayerMilitary],
        }),
        view: this._view
      }),
    });
    this._view.ui.add(editorMil, "bottom-right");&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 15 Jun 2023 05:40:38 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/editor-widget-only-display-defaultsymbol-from/m-p/1299531#M81403</guid>
      <dc:creator>msyazreen</dc:creator>
      <dc:date>2023-06-15T05:40:38Z</dc:date>
    </item>
    <item>
      <title>Re: Editor widget only display defaultSymbol from UniqueValueRenderer</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/editor-widget-only-display-defaultsymbol-from/m-p/1299549#M81404</link>
      <description>&lt;P&gt;here is my code in codepen. change to simple one using&amp;nbsp;SimpleLineSymbol but still only defaultSymbol shown. i know im missing something...&lt;/P&gt;&lt;P&gt;&lt;A href="https://codepen.io/msyazreen/pen/gOQPRVa?editors=100" target="_blank"&gt;https://codepen.io/msyazreen/pen/gOQPRVa?editors=100&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 15 Jun 2023 07:12:34 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/editor-widget-only-display-defaultsymbol-from/m-p/1299549#M81404</guid>
      <dc:creator>msyazreen</dc:creator>
      <dc:date>2023-06-15T07:12:34Z</dc:date>
    </item>
    <item>
      <title>Re: Editor widget only display defaultSymbol from UniqueValueRenderer</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/editor-widget-only-display-defaultsymbol-from/m-p/1299883#M81408</link>
      <description>&lt;P&gt;By making the following changes to your codepen, it appears to work as you would expect:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;&amp;lt;html lang="en"&amp;gt;
  &amp;lt;head&amp;gt;
    &amp;lt;meta charset="utf-8" /&amp;gt;
    &amp;lt;meta
      name="viewport"
      content="initial-scale=1,maximum-scale=1,user-scalable=no"
    /&amp;gt;
    &amp;lt;!--
     ArcGIS Maps SDK for JavaScript, https://js.arcgis.com
     For more information about the widgets-editor-basic sample,
     read the original sample description at developers.arcgis.com.
     https://developers.arcgis.com/javascript/latest/sample-code/widgets-editor-basic/
     --&amp;gt;
    &amp;lt;title&amp;gt;
      Edit features with the Editor widget | Sample | ArcGIS Maps SDK for
      JavaScript 4.27
    &amp;lt;/title&amp;gt;

    &amp;lt;link
      rel="stylesheet"
      href="https://js.arcgis.com/4.27/esri/themes/light/main.css"
    /&amp;gt;
    &amp;lt;script src="https://js.arcgis.com/4.27/"&amp;gt;&amp;lt;/script&amp;gt;

    &amp;lt;style&amp;gt;
      html,
      body,
      #viewDiv {
        padding: 0;
        margin: 0;
        height: 100%;
        width: 100%;
      }
    &amp;lt;/style&amp;gt;

    &amp;lt;script&amp;gt;
      require([
        "esri/WebMap",
        "esri/views/MapView",
        "esri/widgets/Editor",
        "esri/renderers/UniqueValueRenderer",
        "esri/symbols/SimpleLineSymbol",
        "esri/layers/FeatureLayer",
        "esri/geometry/Point",
        "esri/Map"
      ], (
        WebMap,
        MapView,
        Editor,
        UniqueValueRenderer,
        SimpleLineSymbol,
        FeatureLayer,
        Point,
        Map
      ) =&amp;gt; {
        var map = new Map({
          basemap: "topo-vector",
          ground: "world-elevation"
        });

        const view = new MapView({
          container: "viewDiv",
          map: map,
          center: [109.167953, 4.038615],
          zoom: 7,
        });

        let testrenderer = new UniqueValueRenderer({
          field: "msname",
          defaultSymbol: new SimpleLineSymbol({
            color: [236, 71, 71, 255],
            width: 2.25,
            style: "solid"
          }),
          uniqueValueInfos: [
            {
              label: "Full closure",
              value: "abc",
              symbol: new SimpleLineSymbol({
                color: [247, 81, 81, 255],
                width: 2.25,
                style: "solid"
              })
            },
            {
              label: "Partial closure",
              value: "def",
              symbol: new SimpleLineSymbol({
                color: [255, 170, 0, 255],
                width: 2.25,
                style: "solid"
              })
            }
          ]
        });

        let lineLayerMilitary = new FeatureLayer({
          templates: [
            {
              name: "Full Closure",
              prototype: {
                attributes: {
                  msname: "abc"
                }
              }
            },
            {
              name: "Partial Closure",
              prototype: {
                attributes: {
                  msname: "def"
                }
              }
            }
          ],
          source: [],
          visible: true,
          geometryType: "polyline",
          objectIdField: "ObjectID",
          renderer: testrenderer,
          fields: [
            {
              name: "ObjectID",
              alias: "ObjectID",
              type: "oid"
            },
            {
              name: "msname",
              alias: "msname",
              type: "string",
              domain: {
                type: "coded-value",
                name: "d_closure",
                codedValues: [
                  {
                    name: "Full Closure",
                    code: "abc"
                  },
                  {
                    name: "Partial Closure",
                    code: "def"
                  }
                ]
              }
            }
          ]
        });
        view.map.add(lineLayerMilitary);

        view.when(() =&amp;gt; {
          const editor = new Editor({
            view: view,
            layerInfos: [
              {
                layer: lineLayerMilitary // pass in the feature layer,
              }
            ]
          });

          // Add the widget to the view
          view.ui.add(editor, "top-right");
        });
      });
    &amp;lt;/script&amp;gt;
  &amp;lt;/head&amp;gt;

  &amp;lt;body&amp;gt;
    &amp;lt;div id="viewDiv"&amp;gt;&amp;lt;/div&amp;gt;
  &amp;lt;/body&amp;gt;
&amp;lt;/html&amp;gt;&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="changes.png" style="width: 507px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/73394i7E0BF82BF8FEA8C1/image-size/large?v=v2&amp;amp;px=999" role="button" title="changes.png" alt="changes.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 15 Jun 2023 18:17:19 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/editor-widget-only-display-defaultsymbol-from/m-p/1299883#M81408</guid>
      <dc:creator>JoelBennett</dc:creator>
      <dc:date>2023-06-15T18:17:19Z</dc:date>
    </item>
    <item>
      <title>Re: Editor widget only display defaultSymbol from UniqueValueRenderer</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/editor-widget-only-display-defaultsymbol-from/m-p/1300282#M81422</link>
      <description>&lt;P&gt;Thank you! its appear! u really save my time!&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 16 Jun 2023 16:18:40 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/editor-widget-only-display-defaultsymbol-from/m-p/1300282#M81422</guid>
      <dc:creator>msyazreen</dc:creator>
      <dc:date>2023-06-16T16:18:40Z</dc:date>
    </item>
  </channel>
</rss>

