OpenLayers OpenLayers

Ticket #621 (closed bug: fixed)

Opened 2 years ago

Last modified 1 year ago

problem with events on overview map

Reported by: tschaub Assigned to: tschaub
Priority: minor Milestone: 2.4 Release
Component: general Version:
Keywords: Cc:
State:

Description

with apologies to the 2.4 rc1 movement, this is a bug for 2.4

1) go to http://openlayers.org/dev/examples/controls.html

2) open the overview map and try to drag the extent rectangle

3) the map drags instead

Attachments

events.4.patch (1.6 kB) - added by tschaub on 04/02/07 15:45:20.
alternative events patch - less voodoo
eventCacheID.patch (9.3 kB) - added by euzuro on 04/03/07 01:37:22.
instead of using the element's 'id' field to index into the hashtable, assign each element a new, unique '_eventCacheID' property, which will be its key into the events cache hashtable. this way, it matters not if an element is observed has an id or not, nor if the user changes the id later. had to bubble out a new, private _stopObservingElementRow() function, but so be it. I even wrote a big test function with lots of tests to give us a gross sense that this is working. a real, thorough test would obviously be better, but this will do for now. tests pass in FF, IE6
FINAL-eventCacheID.patch (9.3 kB) - added by euzuro on 04/03/07 01:38:41.
ah barf. screwed up checking the replaceexisting attachment checkbox. I wanted to change one little thing in a comment. so here is the final patch.
FINAL-eventCacheID.2.patch (9.3 kB) - added by euzuro on 04/03/07 12:22:00.
final patch.... take two. updated to work with the latest version of trunk, plus renamed row() function to _removeElementObservers() on smart request from sde. tests pass FF & ie6

Change History

04/02/07 15:06:42 changed by tschaub

oddly, this has to do with having a layer switcher and overview map in the map

04/02/07 15:21:25 changed by crschmidt

OpenLayers.Event.stopObservingElement doesn't do so well if it's passed an element which doens't have an ID -- it will unobserve everything that doens't have an ID. Patch incoming.

04/02/07 15:25:04 changed by tschaub

whew, overview map narrowly escapes again

I like the idea of stopObservingElement returning false if elementId is null

OpenLayers.Event.observers[null] is not likely to belong to the correct element

04/02/07 15:29:45 changed by crschmidt

This patch just bails out, in the same way as if there were no events to stop observing. I'll return the number of removed events instead.

04/02/07 15:31:18 changed by crschmidt

  • keywords set to review.

04/02/07 15:45:20 changed by tschaub

  • attachment events.4.patch added.

alternative events patch - less voodoo

04/03/07 01:37:22 changed by euzuro

  • attachment eventCacheID.patch added.

instead of using the element's 'id' field to index into the hashtable, assign each element a new, unique '_eventCacheID' property, which will be its key into the events cache hashtable. this way, it matters not if an element is observed has an id or not, nor if the user changes the id later. had to bubble out a new, private _stopObservingElementRow() function, but so be it. I even wrote a big test function with lots of tests to give us a gross sense that this is working. a real, thorough test would obviously be better, but this will do for now. tests pass in FF, IE6

04/03/07 01:38:41 changed by euzuro

  • attachment FINAL-eventCacheID.patch added.

ah barf. screwed up checking the replaceexisting attachment checkbox. I wanted to change one little thing in a comment. so here is the final patch.

04/03/07 11:28:06 changed by sderle

okay, I don't understand what the heck is going on with this ticket now. can someone explain to me please: (a) which patches are supposed to be applied in which order, and (b) what does the "row" in _stopObservingElementRow() mean, and (c) does this actually fix the problem?

04/03/07 12:02:39 changed by euzuro

the note from my orig patch (which im deleting for clarity):

instead of using the element's 'id' field to index into the hashtable, assign each element a new, unique '_eventCacheID' property, which will be its key into the events cache hashtable. this way, it matters not if an element is observed has an id or not, nor if the user changes the id later. had to bubble out a new, private _stopObservingElementRow() function, but so be it. I even wrote a big test function with lots of tests to give us a gross sense that this is working. a real, thorough test would obviously be better, but this will do for now. tests pass in FF, IE6

04/03/07 12:22:00 changed by euzuro

  • attachment FINAL-eventCacheID.2.patch added.

final patch.... take two. updated to work with the latest version of trunk, plus renamed row() function to _removeElementObservers() on smart request from sde. tests pass FF & ie6

04/03/07 12:48:16 changed by sderle

ok, this seems plausible now. nice work. go ahead and commit.

04/03/07 12:54:31 changed by euzuro

  • status changed from new to closed.
  • resolution set to fixed.

07/05/07 16:57:35 changed by euzuro

  • keywords deleted.