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!"); }
Aangemelde leden kunnen berichten plaatsen, updates volgen en meer. Nieuw hier? Registreer een gratis account.
Find useful guides, FAQs, and documents to help you navigate and make the most of Esri Community.