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(); }); });
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!");
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!"); }
Signed in members can post, follow updates, and more. New here? Register a free account.
Find useful guides, FAQs, and documents to help you navigate and make the most of Esri Community.