Hi dinl, have a look at this example:
http://openlayers.org/dev/examples/draw-undo-redo.html Regards, Germán 2014-07-21 11:01 GMT-05:00 dinl <[email protected]>: > Hi, I'm trying to remove the last feature drawed in the map while the > control > draw is still activated, similar to ctrl + z behavior, I can remove the > last > feature with this code: > > var lineLayer = map.getLayersByName("line_Layer"); > var numFeaturesL = lineLayer [0].features.length-1; > var numComponentsL = lineLayer > [0].features[0].geometry.components.length-1; > var pointToRemove = lineLayer > [0].features[numFeaturesL].geometry.components[numComponentsL]; > lineLayer [0].features[numFeaturesL].geometry.removeComponent(pointToRemove > ); > lineLayer [0].redraw(); > > But this code needs to close the draw with a double click in order to the > features been added to the layer,there is anyway to remove without these > condition?. > > > > > > -- > View this message in context: > http://osgeo-org.1560.x6.nabble.com/Remove-features-in-DrawControl-without-deactivate-the-control-tp5152206.html > Sent from the OpenLayers Users mailing list archive at Nabble.com. > _______________________________________________ > Users mailing list > [email protected] > http://lists.osgeo.org/mailman/listinfo/openlayers-users > -- ----------- |\__ (:>__)( |/ Soluciones Geoinformáticas Libres http://geotux.tuxfamily.org/ http://twitter.com/GeoTux2
_______________________________________________ Users mailing list [email protected] http://lists.osgeo.org/mailman/listinfo/openlayers-users
