I want to clear the features in a vector layer source , I have tried
features.getFeatures().clear();
but it doesn't work!
Look into this documentation page from Openlayers ol.source.Vector
You could include this method as such:
vectorSource.clear