Is there a way to reliably clear-all the EditOverlay features on the client side?
I have tried using these 2 ways but when the application goes to the server side after executing the piece to clear all the features, the EditOverlay still persists the feature information on the Server side.
Method 1:
Map1.ClearFeatures();
Method 2:
function RemoveFeatures() {
var map = Map1.GetOpenLayersMap();
if (map ) {
var colFeatures = map.getLayersByName(EDIT_OVERLAY);
if (colFeatures[0]) {
for(var i=0; i < colFeatures[0].features.length; i++) {
var oFeature = colFeatures[0].features;
oFeature.destroy();
}
if(colFeatures[0].features.length > 0) {
colFeatures[0].destroyFeatures(colFeatures[0].features);
}
}
}
As a work around I am clearing the feature on the server side as follows -
Map1.EditOverlay.Features.Clear();
But it would be really handy if I were able to clear the features on the Client side and thus avoid the postback.
Please let me know if there is any other way this could be done without having to do a application postback.
Thanks..