Looking at the OpenLayers 3 ol.source.Vector docs, I can see that there exists a method ol.Vector.removeFeature(feature)
.
Does this mean the best way to remove all the features from a vector layer would be something like this...?
var iter = layer.getFeatures().values();
while (!(entry = iter.next()).done) {
layer.removeFeature(entry.value);
}
Or is there better way?