<br>2008/5/19 Tim Schaub <<a href="mailto:tschaub@opengeo.org">tschaub@opengeo.org</a>>:<br><div class="gmail_quote"><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
<div class="Ih2E3d">Arnd Wippermann wrote:<br>
> I would appreciate, if the Control.ModifyFeature would enhanced to delete<br>
> features.<br>
<br>
</div>This was originally the intent. Chris suggested it would be too easy to<br>
delete a feature accidentally when you were trying to hover over a<br>
vertex. Providing an option on the control seems like a sensible solution.<br>
</blockquote></div><br><br>You could show a confirm dialog:<br><br> handleKeypress: function(code) {<br> // check for delete key<br> if(this.feature && OpenLayers.Util.indexOf(this.deleteCodes, code) != -1) {<br>
var vertex = this.dragControl.feature;<br> if(vertex && [..]) {<br> // ...<br> } else { // Not over a vertex<br> if(confirm("Do you want to delete the selected feature?")){<br>
var f = this.feature;<br> this.unselectFeature(this);<br> this.layer.removeFeatures([f]);<br> }<br> }<br> }<br> },<br><br>Oscar.<br>