I have a feaureLayer and I don't want to kill it and create another one. I want to delete all features from the current featureLayer. I found that I can use applyEdits method but in order ot use it I need to have all features I want to delete. Whilst I don't want to store them separetly. Do you know a better way to empty my featureLayer when using the ArcGIS Javascript API?
Tell me more
×
Geographic Information Systems Stack Exchange is a question and answer site for
cartographers, geographers and GIS professionals. It's 100% free, no registration required.
|
|
||||
|
|
|
Use featureLayer.selectFeatures() with, as Kirk suggested, a where clause that will return all your features. Once you have all your features, pass them to applyEdits() as the deletes. |
|||||||||||
|
|
Try making a REST delete features call with a where clause "1 = 1" or something similar. |
|||
|
|
Use an Update Cursor, selecting all features ("*"). Use IFeature.Delete(), and store when done. |
|||||
|

