Ticket #2629 (closed feature: wontfix)
OpenLayers.Event: new transversal method addListener.
| Reported by: | jorix | Owned by: | jorix |
|---|---|---|---|
| Priority: | minor | Milestone: | 2.11 Release |
| Component: | Events | Version: | SVN |
| Keywords: | Cc: | ||
| State: |
Description
Advantages of the addListener method:
- This ensures the call of "un" method and the destruction of events
- The developer will forget to call "un" or "unregister" methods
- No are required properties to store: Events instances or functions for call "un" method
- The code is shorter (and better)
- Can register listeners to another object. with correct unregister when object destroy.
Contents of the patch:
- The new methods:
- Events.js
- Base classes which are implemented:
- tests/Map.html
- Map.js
- Control.js
- Popup.js
- How to use in a particular case:
- MousePosition.js (to allow activation/deactivation)
- examples/mouse-position.html (to regiter listeners to another object)
Note that in original MousePosition.js missing unregister of 'mouseout', would not have happened using addListener (therefore the code will be better).
This ticket contains only part of #2577, and is designed to facilitate the reading of the addListener methods within the patch. It has also modified some of the documentation.
SVN revision: 10299
Attachments
Change History
Note: See
TracTickets for help on using
tickets.

