Hi Andreas, For this task (delete a whole feature) I have overwriten OpenLayers.Control.ModifyFeature.prototype.handleKeypress. With the key "k" i kill a feature (only FF).
Mit freundlichen Grüssen Arnd Wippermann http://gis.ibbeck.de/ginfo/ OpenLayers.Control.ModifyFeature.prototype.handleKeypress = function(code) { /** * Method: handleKeypress * Called by the feature handler on keypress. This is used to delete * vertices and point features. If the <deleteCode> property is set, * vertices and points will be deleted when a feature is selected * for modification and the mouse is over a vertex. * * Parameters: * {Integer} Key code corresponding to the keypress event. */ //handleKeypress: function(code) { // check for delete key if(this.feature && OpenLayers.Util.indexOf(this.deleteCodes, code) != -1 && code != 107) { var vertex = this.dragControl.feature; if(vertex && OpenLayers.Util.indexOf(this.vertices, vertex) != -1) { // remove the vertex vertex.geometry.parent.removeComponent(vertex.geometry); this.layer.drawFeature(this.feature, this.selectControl.selectStyle); this.resetVertices(); this.onModification(this.feature); } } else if(this.feature && OpenLayers.Util.indexOf(this.deleteCodes, code) != -1 && code == 107) { var obj = this.feature; var lyr = obj.layer; this.unselectFeature(obj); lyr.removeFeatures(obj); } } -----Ursprüngliche Nachricht----- Von: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Im Auftrag von Andreas Hocevar Gesendet: Mittwoch, 14. Mai 2008 08:15 An: OpenLayers Users Betreff: [OpenLayers-Users] Is it possible to delete a point using theModifyFeature control? A question to all vector editing gurus: Is it possible to make the ModifyFeature control delete a point by clicking the Del button? I know that the Del button will delete vertices on geometries, but what about points (only one vertex)? Is there a simple workaround to delete the whole feature instead of a vertex? Thanks! Andreas. _______________________________________________ Users mailing list [email protected] http://openlayers.org/mailman/listinfo/users _______________________________________________ Users mailing list [email protected] http://openlayers.org/mailman/listinfo/users
