Ticket #1226 (closed bug: fixed)

Opened 5 years ago

Last modified 5 years ago

feature handler calls over and out for every mousemove

Reported by: tschaub Owned by: tschaub
Priority: minor Milestone: 2.6 Release
Component: Handler.Feature Version: 2.5
Keywords: Cc:
State: Complete

Description

This was an oversight on my part. The "over" and "out" callbacks should only be called on mouseover and mouseout of an eligible feature. The "click" callback should be called for every click on an eligible feature. I'm uncertain how the "clickout" callback should behave (only on the first clickout or every click outside a feature).

Attachments

feature.patch Download (3.7 KB) - added by tschaub 5 years ago.
limit callback calling
patch-1226-r5543-A0.diff Download (3.7 KB) - added by elemoine 5 years ago.
definition of the inNew variable placed elsewhere

Change History

Changed 5 years ago by tschaub

limit callback calling

Changed 5 years ago by tschaub

  • state set to Review

Ok, tests pass with this. And, the manual acceptance pass looks good: http://openlayers.org/dev/tests/manual/feature-handler.html (one over/out per mouseover/mouseout). The clickout behavior remains the same (one clickout per click). Uncertain if this needs to be addressed. I think the code is getting a bit thorny, but the behavior is correct (as far as I could tell). Thanks for the review.

Changed 5 years ago by elemoine

definition of the inNew variable placed elsewhere

Changed 5 years ago by elemoine

  • state changed from Review to Commit

Tim, the attached patch just changes where the inNew variable is defined.

If you're ok with that and tests pass please commit.

Next step is #1221.

Changed 5 years ago by tschaub

  • status changed from new to closed
  • state changed from Commit to Complete
  • resolution set to fixed

(In [5555]) Making feature handler call over and out callbacks just once per mouseover and mouseout (of a feature). r=elemoine (closes #1226)

Changed 5 years ago by tschaub

  • status changed from closed to reopened
  • resolution fixed deleted

This broke the modify feature control. To see the problem,

  1. open modify-feature.html
  2. draw a polygon
  3. modify feature with rotation
  4. rotate the handle and then click the feature to unselect

Changed 5 years ago by tschaub

  • status changed from reopened to closed
  • resolution set to fixed

Ok, this change just exposed the problem with the modify feature control. This is addressed in #1235.

Note: See TracTickets for help on using tickets.