<?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: disable geometryUpdatesEnabled in ArcGIS JavaScript Maps SDK Questions</title>
    <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/disable-geometryupdatesenabled/m-p/1357502#M83039</link>
    <description>&lt;P&gt;No, the problem here is that those properties have been added in the wrong location.&amp;nbsp; Instead, see lines 74, 88, and 125 below:&lt;/P&gt;&lt;LI-CODE lang="javascript"&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;title&amp;gt;Editor widget with configurations | Sample | ArcGIS Maps SDK for JavaScript 4.28&amp;lt;/title&amp;gt;
    &amp;lt;link rel="stylesheet" href="https://js.arcgis.com/4.28/esri/themes/light/main.css" /&amp;gt;
    &amp;lt;script src="https://js.arcgis.com/4.28/"&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"], function (
        WebMap,
        MapView,
        Editor
      ) {
          let editConfigCrimeLayer, editConfigPoliceLayer;

          // Create a map from the referenced webmap item id
          let webmap = new WebMap({
            portalItem: {
              id: "154ba34201774bb29f7c3b68adf52b6a"
            }
          });

          let view = new MapView({
            container: "viewDiv",
            map: webmap
          });

        view.when(() =&amp;gt; {
          // Create a custom group to separate the different areas of crime.
          // This function takes a 'grouping' object which contains a feature template and a feature layer.

          function customGroup(grouping) {
            // If the layer is 'Police routes', do not group.
            let groupHeading = "Police Routes";
            if (grouping.layer.title.toLowerCase() === "crime map") {
              switch (grouping.template.name) {
                case "Criminal Homicide":
                case "Rape":
                case "Robbery":
                case "Aggravated Assault":
                  groupHeading = "Violent Crime";
                  break;
                case "Arson":
                case "Burglary":
                case "Larceny":
                case "Motor Vehicle Theft":
                  groupHeading = "Property Crime";
                  break;
                default:
                  groupHeading = "Quality of Life";
              }
            }
            return groupHeading;
          }

          // Loop through the webmap's layers and set an edit configuration
          view.map.layers.forEach((layer) =&amp;gt; {
            if (layer.title === "Police routes") {
              editConfigPoliceLayer = {
                layer: layer,
                geometryUpdatesEnabled: false,
                formTemplate: { //autocastable to FormTemplate
                // Set it so that only one field displays within the form
                  elements: [{ // autocastable to FieldElement
                    type: "field",
                    fieldName: "PatrolType",
                    label: "Patrol Type"
                  }]
                }
              };
            } else {
              // Specify a few of the fields to edit within the form
              editConfigCrimeLayer = {
                layer: layer,
                geometryUpdatesEnabled: false,
                formTemplate: { // autocastable to FormTemplate
                  elements: [{ // autocastable to FieldElement
                      type: "field",
                      fieldName: "fulladdr",
                      label: "Full Address"
                    },
                    {
                      type: "field",
                      fieldName: "neighborhood",
                      label: "Neighborhood"
                    },
                    {
                      type: "field",
                      fieldName: "ucrdesc",
                      label: "UCR Description"
                    },
                    {
                      type: "field",
                      fieldName: "crimecategory",
                      label: "Category"
                    },
                    {
                      type: "field",
                      fieldName: "casestatus",
                      label: "Status"
                    }
                  ]
                }
              };
            }
          });

          // Create the Editor
          const editor = new Editor({
            view: view,
            // Pass in the configurations created above
            layerInfos: [editConfigCrimeLayer, editConfigPoliceLayer],
            // Override the default template behavior of the Editor widget
            supportingWidgetDefaults: {
              featureTemplates: {
                groupBy: customGroup
              }
            }
          });

          // Add 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;div id="editorDiv"&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;</description>
    <pubDate>Wed, 06 Dec 2023 17:45:10 GMT</pubDate>
    <dc:creator>JoelBennett</dc:creator>
    <dc:date>2023-12-06T17:45:10Z</dc:date>
    <item>
      <title>disable geometryUpdatesEnabled</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/disable-geometryupdatesenabled/m-p/1357193#M83029</link>
      <description>&lt;P&gt;I tried to modify this example to disable the editing of geometry of existing features, but it doesn't work. Bug?&lt;/P&gt;&lt;P&gt;&lt;A href="https://codepen.io/lkoumis1/pen/MWLZPyJ?editors=1000" target="_blank" rel="noopener"&gt;https://codepen.io/lkoumis1/pen/MWLZPyJ?editors=1000&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;const editor = new Editor({
            view: view,
            // Pass in the configurations created above
            layerInfos: [{
              layer:editConfigCrimeLayer,
              geometryUpdatesEnabled: false
            },
            {layer:editConfigPoliceLayer,
            geometryUpdatesEnabled: false
            }],&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Reference:&amp;nbsp;&lt;A href="https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Editor.html#layerInfos" target="_self"&gt;https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Editor.html#layerInfos&lt;/A&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 06 Dec 2023 00:26:17 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/disable-geometryupdatesenabled/m-p/1357193#M83029</guid>
      <dc:creator>LefterisKoumis</dc:creator>
      <dc:date>2023-12-06T00:26:17Z</dc:date>
    </item>
    <item>
      <title>Re: disable geometryUpdatesEnabled</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/disable-geometryupdatesenabled/m-p/1357502#M83039</link>
      <description>&lt;P&gt;No, the problem here is that those properties have been added in the wrong location.&amp;nbsp; Instead, see lines 74, 88, and 125 below:&lt;/P&gt;&lt;LI-CODE lang="javascript"&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;title&amp;gt;Editor widget with configurations | Sample | ArcGIS Maps SDK for JavaScript 4.28&amp;lt;/title&amp;gt;
    &amp;lt;link rel="stylesheet" href="https://js.arcgis.com/4.28/esri/themes/light/main.css" /&amp;gt;
    &amp;lt;script src="https://js.arcgis.com/4.28/"&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"], function (
        WebMap,
        MapView,
        Editor
      ) {
          let editConfigCrimeLayer, editConfigPoliceLayer;

          // Create a map from the referenced webmap item id
          let webmap = new WebMap({
            portalItem: {
              id: "154ba34201774bb29f7c3b68adf52b6a"
            }
          });

          let view = new MapView({
            container: "viewDiv",
            map: webmap
          });

        view.when(() =&amp;gt; {
          // Create a custom group to separate the different areas of crime.
          // This function takes a 'grouping' object which contains a feature template and a feature layer.

          function customGroup(grouping) {
            // If the layer is 'Police routes', do not group.
            let groupHeading = "Police Routes";
            if (grouping.layer.title.toLowerCase() === "crime map") {
              switch (grouping.template.name) {
                case "Criminal Homicide":
                case "Rape":
                case "Robbery":
                case "Aggravated Assault":
                  groupHeading = "Violent Crime";
                  break;
                case "Arson":
                case "Burglary":
                case "Larceny":
                case "Motor Vehicle Theft":
                  groupHeading = "Property Crime";
                  break;
                default:
                  groupHeading = "Quality of Life";
              }
            }
            return groupHeading;
          }

          // Loop through the webmap's layers and set an edit configuration
          view.map.layers.forEach((layer) =&amp;gt; {
            if (layer.title === "Police routes") {
              editConfigPoliceLayer = {
                layer: layer,
                geometryUpdatesEnabled: false,
                formTemplate: { //autocastable to FormTemplate
                // Set it so that only one field displays within the form
                  elements: [{ // autocastable to FieldElement
                    type: "field",
                    fieldName: "PatrolType",
                    label: "Patrol Type"
                  }]
                }
              };
            } else {
              // Specify a few of the fields to edit within the form
              editConfigCrimeLayer = {
                layer: layer,
                geometryUpdatesEnabled: false,
                formTemplate: { // autocastable to FormTemplate
                  elements: [{ // autocastable to FieldElement
                      type: "field",
                      fieldName: "fulladdr",
                      label: "Full Address"
                    },
                    {
                      type: "field",
                      fieldName: "neighborhood",
                      label: "Neighborhood"
                    },
                    {
                      type: "field",
                      fieldName: "ucrdesc",
                      label: "UCR Description"
                    },
                    {
                      type: "field",
                      fieldName: "crimecategory",
                      label: "Category"
                    },
                    {
                      type: "field",
                      fieldName: "casestatus",
                      label: "Status"
                    }
                  ]
                }
              };
            }
          });

          // Create the Editor
          const editor = new Editor({
            view: view,
            // Pass in the configurations created above
            layerInfos: [editConfigCrimeLayer, editConfigPoliceLayer],
            // Override the default template behavior of the Editor widget
            supportingWidgetDefaults: {
              featureTemplates: {
                groupBy: customGroup
              }
            }
          });

          // Add 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;div id="editorDiv"&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;</description>
      <pubDate>Wed, 06 Dec 2023 17:45:10 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/disable-geometryupdatesenabled/m-p/1357502#M83039</guid>
      <dc:creator>JoelBennett</dc:creator>
      <dc:date>2023-12-06T17:45:10Z</dc:date>
    </item>
    <item>
      <title>Re: disable geometryUpdatesEnabled</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/disable-geometryupdatesenabled/m-p/1357581#M83041</link>
      <description>&lt;P&gt;THank you. It works. I thought it was a bug based on the ESRI's example. But actually the code posted is missing some commas and it breaks the code.&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="LefterisKoumis_0-1701889388182.png" style="width: 400px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/88197i07CCCB1F9ECAA173/image-size/medium?v=v2&amp;amp;px=400" role="button" title="LefterisKoumis_0-1701889388182.png" alt="LefterisKoumis_0-1701889388182.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 06 Dec 2023 19:03:55 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/disable-geometryupdatesenabled/m-p/1357581#M83041</guid>
      <dc:creator>LefterisKoumis</dc:creator>
      <dc:date>2023-12-06T19:03:55Z</dc:date>
    </item>
  </channel>
</rss>

