I'm trying to use the esri-leaflet example on editing (https://esri.github.io/esri-leaflet/examples/editing.html) to edit two different featureLayers.
First when I add a point with leaflet draw, I want it to automatically create a buffer around the point. I can get it to add the circle in 'draw:created' by pulling the points (lat & lng) from the marker and giving it a radius.
map.on('draw:created', function (e) {
// add the feature as GeoJSON (feature will be converted to ArcGIS JSON internally)
collectionBoxes.addFeature(e.layer.toGeoJSON());
// createBuffer using the lat lng from marker added by leaflet draw
var circle = L.circle([e.layer._latlng.lat, e.layer._latlng.lng], 304.8).addTo(drawnItems);
// try to add buffer to arcgis service
buffers.addFeature(circle.toGeoJSON());
disableEditing = false;
});
This line adds a circle on the map.
var circle = L.circle([e.layer._latlng.lat, e.layer._latlng.lng], 304.8).addTo(drawnItems);
This line does not give any errors.
'buffers.addFeatures(circle.toGeoJSON);'
but does not edit the arcgis service for the buffer. The point layer (collectionBoxes) does get edited. Any ideas on this or how to edit the example to edit two layers?