<?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 Cannot change symbol of geometry when using applyEdits() in ArcGIS JavaScript Maps SDK Questions</title>
    <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/cannot-change-symbol-of-geometry-when-using/m-p/1258767#M80280</link>
    <description>&lt;P&gt;Sorry for my bad English.&amp;nbsp;&lt;SPAN&gt;When I tried to change the symbol of many geometry by using Query and applyEdit(), when i clicked the button to do so, the geometry met the query conditions only blink and get back to the old symbol.&lt;/SPAN&gt;&amp;nbsp;Here is my code:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;   var pointGeometry = new Point({
                        x: 115.31,
                        y: -2.14,
                        spatialReference: 4326
                    });

                    var bufferDistance = 75;
                    var bufferGeometry = geometryEngine.geodesicBuffer(pointGeometry, bufferDistance, "kilometers");

                    var query = fl.createQuery();
                    query.geometry = bufferGeometry;
                    query.returnGeometry = true;

                    fl.queryFeatures(query).then(function (response) {
                        var geometryResult = [];
                        response.features.forEach(function (feature) {
                            if (feature.attributes.IsComplete == "true") {
                                geometryResult.push(feature.attributes[fl.objectIdField]);
                            }
                        });
                        console.log(geometryResult);
                        var query2 = fl.createQuery();
                        query2.objectIds = geometryResult;
                        fl.queryFeatures(query2).then(function (result) {
                            let sym = {
                                type: "simple-marker",  // autocasts as new SimpleMarkerSymbol()
                                color: "red",
                                outline: {  // autocasts as new SimpleLineSymbol()
                                    color: [128, 128, 128, 0.5],
                                    width: "0.5px"
                                }
                            };

                            result.features.forEach(function (feature) {
                                feature.symbol = sym;
                            });

                            const edits = {
                                updateFeatures: result.features
                            };

                            fl.applyEdits(edits).then(function () {
                                console.log("success");
                            }).catch(function (error) {
                                console.error("fail: ", error);
                            });
                        });
                    });&lt;/LI-CODE&gt;&lt;P&gt;Thank for your help&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Thu, 16 Feb 2023 02:54:13 GMT</pubDate>
    <dc:creator>LazyDogz</dc:creator>
    <dc:date>2023-02-16T02:54:13Z</dc:date>
    <item>
      <title>Cannot change symbol of geometry when using applyEdits()</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/cannot-change-symbol-of-geometry-when-using/m-p/1258767#M80280</link>
      <description>&lt;P&gt;Sorry for my bad English.&amp;nbsp;&lt;SPAN&gt;When I tried to change the symbol of many geometry by using Query and applyEdit(), when i clicked the button to do so, the geometry met the query conditions only blink and get back to the old symbol.&lt;/SPAN&gt;&amp;nbsp;Here is my code:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;   var pointGeometry = new Point({
                        x: 115.31,
                        y: -2.14,
                        spatialReference: 4326
                    });

                    var bufferDistance = 75;
                    var bufferGeometry = geometryEngine.geodesicBuffer(pointGeometry, bufferDistance, "kilometers");

                    var query = fl.createQuery();
                    query.geometry = bufferGeometry;
                    query.returnGeometry = true;

                    fl.queryFeatures(query).then(function (response) {
                        var geometryResult = [];
                        response.features.forEach(function (feature) {
                            if (feature.attributes.IsComplete == "true") {
                                geometryResult.push(feature.attributes[fl.objectIdField]);
                            }
                        });
                        console.log(geometryResult);
                        var query2 = fl.createQuery();
                        query2.objectIds = geometryResult;
                        fl.queryFeatures(query2).then(function (result) {
                            let sym = {
                                type: "simple-marker",  // autocasts as new SimpleMarkerSymbol()
                                color: "red",
                                outline: {  // autocasts as new SimpleLineSymbol()
                                    color: [128, 128, 128, 0.5],
                                    width: "0.5px"
                                }
                            };

                            result.features.forEach(function (feature) {
                                feature.symbol = sym;
                            });

                            const edits = {
                                updateFeatures: result.features
                            };

                            fl.applyEdits(edits).then(function () {
                                console.log("success");
                            }).catch(function (error) {
                                console.error("fail: ", error);
                            });
                        });
                    });&lt;/LI-CODE&gt;&lt;P&gt;Thank for your help&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 16 Feb 2023 02:54:13 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/cannot-change-symbol-of-geometry-when-using/m-p/1258767#M80280</guid>
      <dc:creator>LazyDogz</dc:creator>
      <dc:date>2023-02-16T02:54:13Z</dc:date>
    </item>
    <item>
      <title>Re: Cannot change symbol of geometry when using applyEdits()</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/cannot-change-symbol-of-geometry-when-using/m-p/1258901#M80292</link>
      <description>&lt;P&gt;You cannot change the symbols of features in a FeatureLayer. The symbol changes happen through the layer's &lt;A href="https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#renderer" target="_self"&gt;renderer&lt;/A&gt;. Be sure to check out the &lt;A href="https://developers.arcgis.com/javascript/latest/visualization/" target="_self"&gt;Styles and data visualization&lt;/A&gt; doc to learn more info.&lt;/P&gt;</description>
      <pubDate>Thu, 16 Feb 2023 15:26:54 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/cannot-change-symbol-of-geometry-when-using/m-p/1258901#M80292</guid>
      <dc:creator>UndralBatsukh</dc:creator>
      <dc:date>2023-02-16T15:26:54Z</dc:date>
    </item>
  </channel>
</rss>

