[OpenLayers-Users] Is it possible to delete a point using theModifyFeature control?

Arnd Wippermann arnd.wippermann at web.de
Tue May 27 13:49:46 EDT 2008


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

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




  _____  

Von: oscar.fonts.lists at gmail.com [mailto:oscar.fonts.lists at gmail.com] 
Gesendet: Dienstag, 27. Mai 2008 08:53
An: Tim Schaub
Cc: Arnd Wippermann; users at openlayers.org
Betreff: Re: [OpenLayers-Users] Is it possible to delete a point using
theModifyFeature control?



2008/5/19 Tim Schaub <tschaub at opengeo.org>:


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.

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.osgeo.org/pipermail/openlayers-users/attachments/20080527/f0f4f681/attachment.html


More information about the Users mailing list