Thanks Oscar,
 
That's right. I will update my code
 
Mit freundlichen GrĂ¼ssen

Arnd Wippermann
http://gis.ibbeck.de/ginfo/




  _____  

Von: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] 
Gesendet: Dienstag, 27. Mai 2008 08:53
An: Tim Schaub
Cc: Arnd Wippermann; [email protected]
Betreff: Re: [OpenLayers-Users] Is it possible to delete a point using
theModifyFeature control?



2008/5/19 Tim Schaub <[EMAIL PROTECTED]>:


Arnd Wippermann wrote:
> I would appreciate, if the Control.ModifyFeature would enhanced to delete
> features.


This was originally the intent.  Chris suggested it would be too easy to
delete a feature accidentally when you were trying to hover over a
vertex.  Providing an option on the control seems like a sensible solution.




You could show a confirm dialog:

    handleKeypress: function(code) {
        // check for delete key
        if(this.feature && OpenLayers.Util.indexOf(this.deleteCodes, code)
!= -1) {
            var vertex = this.dragControl.feature;
            if(vertex && [..]) {
                // ...
            } else { // Not over a vertex
                if(confirm("Do you want to delete the selected feature?")){
                    var f = this.feature;
                    this.unselectFeature(this);
                    this.layer.removeFeatures([f]);
                }
            }
        }
    },

Oscar.

_______________________________________________
Users mailing list
[email protected]
http://openlayers.org/mailman/listinfo/users

Reply via email to