Hi, I have something like:
--------------------------- var MLayerTemp =(...) //New vertor layer MLayerTemp.events.register("beforefeatureadded", MLayerTemp, function(MElemento){ MElemento.object.removeFeatures([MElemento.feature]); MElemento.object.destroyFeatures(); return true; } ); //And then I add the OpenLayers.Control.DrawFeature to the map --------------------------- The problem is that whe the event function is called, the feature is not in the screen map, but it is in the features array of the layer. So the problem is: If I need to delete all features before inserting the new one, I can not do something like: --------------------------- function(MElemento){ MElemento.object.destroyFeatures(); return true; } --------------------------- Becouse this erases also the new feature I try to insert!! Is it normal that the new feature to insert is already in the feature layers' Array? I think it shoul not to be in the array, so we have not decided yet if it can be inserted or not. Anyway, another problem: If I return false... The feature is inserted!!! The documentatio says it should not be inserted. Any help will be appreciated, Thanks Esteban Olm
_______________________________________________ Dev mailing list Dev@openlayers.org http://openlayers.org/mailman/listinfo/dev