[OpenLayers-Dev] DeleteFeature control

Alexandre Dube adube at mapgears.com
Fri Jul 17 08:28:19 EDT 2009


  I'd like to ask a couple of questions about this control.

  Currently, the only thing it really does is change the state of the 
selected features to DELETE and on 'del' keypress, it triggers a 
'deletefeatures' event, but it doesn't actually delete (commit, destroy, 
remove, etc.) anything.  The user needs to listen to the event and do 
what he wants himself.

  That bugs me a little.  What good is a "DeleteFeature" control if it 
doesn't do anything by itself ?  So I'm thinking of adding a couple of 
functions that would take care of theses actions, but at the same time 
I'm aware of the Strategy.Save strategy that already has the role of 
committing changes.  It's not supporting HTTP/MapFish protocol at the 
moment though...

  Here's what I would do :

  - add a boolean 'commit' property
    - false : only destroy the features on screen
    - true : commit the changes (using the Save strategy or 

  Since I'm using featureserver and Protocol.MapFish (which is not part 
of the OpenLayers project) I can't figure how I could avoid to delete 
'manually' the features, i.e. not in the control itself.

  Any hint would be appreciated,


Alexandre Dube wrote:
> Hi,
>   I just sent (finally) a new patch for ticket 1882 (1) (DeleteFeature 
> control) and set the status to review.
> (1) http://trac.openlayers.org/ticket/1882
> Regards,

Alexandre Dubé

More information about the Dev mailing list