Search code examples
javascriptesri

featureLayer.applyEdits saves POINT EMPTY in esri javascript API


esri javascript API featureLayer.applyEdits some time works and most of time saves POINT EMPTY in Geometry and set rest of attributes with Null value here is the code

 featureLayer.applyEdits(drawnItems, null, null, function (add, update, del) {
                console.log(JSON.stringify(drawnItems[0].attributes));
                ContaminantLayer.refresh();
                if(add[0].success===true)
                {
                  console.log("Success");
                }
             else {
                    toastr.error("Error occured ");
                }
            }, function (error) {
                toastr.error("Error occured ");

            });

Solution

  • I found the issue, I need to use Simplify() before saving the Geometry

    https://developers.arcgis.com/javascript/3/jsapi/esri.geometry.geometryengine-amd.html#simplify