1

I am developping a web application with arcgis javascript api. I am using arcgis server 10.2. I declared a featureLayer, the URL of this featureLayer is a feature service on my server. Using a geoprocessing service, I am able to create features from the results of the service. I am able to add the features to the featureLayer I declared and show them in the map, but the problem is the changes made are not saved on the server. this is the code sample:

 function displayResults(results, messages) {
 var flayer = new esri.layers.FeatureLayer("http://hamri-pc:6080/arcgis/rest/services/edt/FeatureServer/0", {
 mode: esri.layers.FeatureLayer.MODE_ONDEMAND,
 outFields: ['*']
 }); 
 var features = results[0].value.features;
 var theExtent = null;
 for (var f = 0, fl = features.length; f < fl; f++) {
 var feature = features[f];
 var attribs = feature.attributes;
 feature.setSymbol(normalpictureMarkerSymbol);
 feature.setInfoTemplate(infoTemplate);
 flayer.add(feature);
 flayer.applyEdits(feature,null,null);
 map.addLayers([flayer]);
 }
 }

Does anyone have an idea of what should I do to save the features in the server?

asked May 23, 2014 at 14:01

1 Answer 1

2

Change this line

flayer.applyEdits(feature,null,null);

to

flayer.applyEdits(null, [feature], null);
answered May 23, 2014 at 14:51
1
  • Thank you for your comment. My problem is solved now I used flayer.applyEdites([feature],null,null); Commented May 24, 2014 at 12:21

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

By clicking "Post Your Answer", you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.