[OpenLayers-Trac] Re: [OpenLayers] #3016: ModifyFeature - "del" key press outside vertice should delete the feature

OpenLayers trac-20090302 at openlayers.org
Wed May 11 08:43:39 EDT 2011


#3016: ModifyFeature - "del" key press outside vertice should delete the feature
-----------------------------------+----------------------------------------
 Reporter:  adube                  |       Owner:  tschaub     
     Type:  feature                |      Status:  new         
 Priority:  minor                  |   Milestone:  2.11 Release
Component:  Control.ModifyFeature  |     Version:  2.10        
 Keywords:  del, delete, key       |       State:  Review      
-----------------------------------+----------------------------------------

Comment(by adube):

 Replying to [comment:16 erilem]:
 > In [attachment:patch-openlayers-3016-r11965-A4.diff] I've reworked the
 tests a bit. I've also added information in the featurestatechanged event
 doc text, removed {{{this.prevState = null}}} in the {{{Feature.Vector}}}
 constructor,

 Thanks a lot for those fixes.[[BR]][[BR]]

 > and changed the names of the properties in the event ({{{state}}} ->
 {{{newState}}}, {{{previous}}} -> {{{prevState}}}). Tell me what you
 think.

 I agree.  It's more verbose that way.[[BR]][[BR]]

 >
 > Also, without your patch {{{toState}}} does nothing when {{{state}}} is
 {{{DELETE}}} and {{{this.state}}} is {{{INSERT}}}; with your patch
 {{{toState}}} does set the feature state to {{{DELETE}}} in that case. I
 guess you've purposefully changed that behavior, for a
 {{{featurestatechanged}}} event to be triggered in that case. I think it's
 fine, but the application code will need to behave correctly in that case,
 by destroying the feature right away. Do you agree?

 Yes, I agree and you perfectly understood the issued I faced.  When I
 tried to add new features (state == {{{INSERT}}}) and used the del key to
 pop a {{{"Are you sure ?"}}} message using the {{{featurestatechanged}}}
 event, the toState was never called, nor the state set to {{{DELETE}}}.

 Thanks a lot for your review.

-- 
Ticket URL: <http://trac.openlayers.org/ticket/3016#comment:17>
OpenLayers <http://openlayers.org/>
A free AJAX map viewer


More information about the Trac mailing list