<div dir="ltr">Hi dinl, <div><br></div><div style>have a look at this example: </div><div style><br></div><div style><a href="http://openlayers.org/dev/examples/draw-undo-redo.html">http://openlayers.org/dev/examples/draw-undo-redo.html</a><br>

</div><div style><br></div><div style><br></div><div style>Regards, </div><div style><br></div><div style>Germán</div><div class="gmail_extra"><br><br><div class="gmail_quote">2014-07-21 11:01 GMT-05:00 dinl <span dir="ltr"><<a href="mailto:dinl_@hotmail.com" target="_blank">dinl_@hotmail.com</a>></span>:<br>

<blockquote class="gmail_quote" style="margin-top:0px;margin-right:0px;margin-bottom:0px;margin-left:0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">Hi, I'm trying to remove the last feature drawed in the map while the control<br>


draw is still activated, similar to ctrl + z behavior, I can remove the last<br>
feature with this code:<br>
<br>
var lineLayer = map.getLayersByName("line_Layer");<br>
var numFeaturesL = lineLayer [0].features.length-1;<br>
var numComponentsL = lineLayer [0].features[0].geometry.components.length-1;<br>
var pointToRemove = lineLayer<br>
[0].features[numFeaturesL].geometry.components[numComponentsL];<br>
lineLayer [0].features[numFeaturesL].geometry.removeComponent(pointToRemove<br>
);<br>
lineLayer [0].redraw();<br>
<br>
But this code needs to close the draw with a double click in order to the<br>
features been added to the layer,there is anyway to remove without these<br>
condition?.<br>
<br>
<br>
<br>
<br>
<br>
--<br>
View this message in context: <a href="http://osgeo-org.1560.x6.nabble.com/Remove-features-in-DrawControl-without-deactivate-the-control-tp5152206.html" target="_blank">http://osgeo-org.1560.x6.nabble.com/Remove-features-in-DrawControl-without-deactivate-the-control-tp5152206.html</a><br>


Sent from the OpenLayers Users mailing list archive at Nabble.com.<br>
_______________________________________________<br>
Users mailing list<br>
<a href="mailto:Users@lists.osgeo.org">Users@lists.osgeo.org</a><br>
<a href="http://lists.osgeo.org/mailman/listinfo/openlayers-users" target="_blank">http://lists.osgeo.org/mailman/listinfo/openlayers-users</a><br>
</blockquote></div><br><br clear="all"><div><br></div>-- <br>-----------<br>   |\__  <br>(:>__)(<br>   |/    <br><br>Soluciones Geoinformáticas Libres                            <br><a href="http://geotux.tuxfamily.org/">http://geotux.tuxfamily.org/</a><br>

<a href="http://twitter.com/GeoTux2">http://twitter.com/GeoTux2</a><br>
</div></div>