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