AnsweredAssumed Answered

Only display the latest feature added

Question asked by henryboston on Feb 28, 2014
Latest reply on Mar 4, 2014 by btfou
I'm trying to modify the following sample to only show the latest feature added to the map. 

The sample is located here: https://developers.arcgis.com/javascript/jssamples/ed_attributeInspectorValidate.html

I've tried to change

//Add the editable feature layer to the map         var pointsOfInterest = new esri.layers.FeatureLayer("http://sampleserver5.arcgisonline.com/ArcGIS/rest/services/Notes/FeatureServer/0",{           mode: esri.layers.FeatureLayer.MODE_ONDEMAND,            outFields: ['*']         });


from MODE_ONDEMAND to MODE_SELECTION

//Add the editable feature layer to the map         var pointsOfInterest = new esri.layers.FeatureLayer("http://sampleserver5.arcgisonline.com/ArcGIS/rest/services/Notes/FeatureServer/0",{           mode: esri.layers.FeatureLayer.MODE_SELECTION,            outFields: ['*']         });


Which works when adding a new feature but as soon as the user clicks anywhere else on the map the newly added feature disappears.  Is there anyway to modify the code so that the newly added feature remains displayed until another feature is added? Effectively making it so only the latest feature is shown on the map.

Thanks!

Outcomes