I have a shapefile hosted as Feature Layer at ESRI Server.

I create a Leaflet application where I want to enable an attributes update of my Feature Layer (field 'Status'). I have customized a popup where users can choose an attribute value from the list. This value has to be sent to the server as soon as they click the "OK" button.

I tried to make use of Ajax. Console log returns an updated attribute, however I can not see any changes when I look at the data at ESRI Server.

Probably UpdateFeature function works only with geometry.

var net = L.esri.featureLayer({ url: netURL}).addTo(map);

var status_content = '<form role="form" id="form" enctype="multipart/form-data" onsubmit="addMarker()">'+
                  '<p style="font-size:12px;"><b>Update status</b></p>'+
                      '<select class="form-control" id="st" name="new_status">'+
                        '<option value="etab">Established</option>'+
                        '<option value="plan">Planned</option>'+
                        '<option value="default">Default</option>'+
                  '<div align="right" >'+
                  '<button type="button" title="Save new status" class="ok" id="OK"><img src="ok.png"></button>'+

net.on('click', function(e) {
              e.layer.feature.properties["Status"] = $("#st").val();
              console.log (e.layer.feature.properties.Status);

1 Answer 1


I have figured it out myself.

It started to work as soon as I changed the line




You have also be sure that the hosted Feature Layer is open for editing (updating of attributes in my case). This can be done via Layer Setting at ArcGIS Server.

  • exactly. nice work! Feb 7, 2019 at 19:02

Your Answer

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.