Solved! Go to Solution.
map.on("click", function(evt) { featureLayer.selectFeatures(query, FeatureLayer.SELECTION_NEW, function(results) { //use the method callback to dig into the results and update its geometry results[0].geometry = evt.mapPoint; //pass the entire array (in this case one feature) back to the server featureLayer.applyEdits(null, results, null); //refresh the layer to make sure the edit was successful featureLayer.refresh(); }); });
graphic = new Graphic(pt, null,null); map.graphics.add(graphic); query.geometry = feature.geometry; featureLayer.selectFeatures(query, FeatureLayer.SELECTION_NEW, function(results){ new esri.geometry.Point(pt, map.spatialReference); graphic.setGeometry(pt); featureLayer.applyEdits( null,[graphic], null); console.log(" Fire on everything!"); }
query.where = "cycle = 12"; graphic = new Graphic(pt, symbol,attr); map.graphics.add(graphic); featureLayer.selectFeatures(query,FeatureLayer.SELECTION_NEW); new esri.geometry.Point(pt, map.spatialReference); graphic.setGeometry(pt); featureLayer.applyEdits( null,[graphic], null); console.log(" Fire on everything!");
map.on("click", function(evt) { featureLayer.selectFeatures(query, FeatureLayer.SELECTION_NEW, function(results) { //use the method callback to dig into the results and update its geometry results[0].geometry = evt.mapPoint; //pass the entire array (in this case one feature) back to the server featureLayer.applyEdits(null, results, null); //refresh the layer to make sure the edit was successful featureLayer.refresh(); }); });