[OpenLayers-Trac] [OpenLayers] #1189: allow triggerEvent to be called with additional arguments for the listener
OpenLayers
trac at openlayers.org
Tue Dec 4 18:37:45 EST 2007
#1189: allow triggerEvent to be called with additional arguments for the listener
---------------------+------------------------------------------------------
Reporter: tschaub | Owner: euzuro
Type: feature | Status: new
Priority: minor | Milestone: 2.6 Release
Component: Events | Version: 2.5
Keywords: |
---------------------+------------------------------------------------------
Our triggerEvent method just calls all listeners (optionally bound to some
caller). This can be modified easily to call listeners with additional
arguments. This makes event stuff more fun.
Pretend a drag feature control wanted to trigger a "predragfeature" event
on a layer. Listeners should expect to receive the feature in question
and perhaps the start and end pixel (of the drag). In addition, if
triggerEvent returns the return from the last listener, then that control
can modify its behavior (undo the drag for example) if the arguments
(start and end pixel in this case) don't meet some user specified
criteria.
Just a mocked up example, but this would give us way more flexibility with
our event magic. Basically, I'm asking for triggerEvent to take an
optional third argument and return continueChain.
--
Ticket URL: <http://trac.openlayers.org/ticket/1189>
OpenLayers <http://openlayers.org/>
A free AJAX map viewer
More information about the Trac
mailing list