[OpenLayers-Users] Capturing mouse events

Piero Campa piero.campa at gmail.com
Fri Jul 23 03:38:19 EDT 2010


Well, regarding the mouse 'clicks' you should take a look at the source of
this example:
http://openlayers.org/dev/examples/click-handler.html
It's something about defining a class OpenLayers.Control.Click inheriting
from OpenLayers.Control, then defining the click Handlers.

Whether you'd like instead to manage mouse moves you can just register the
event, e.g.
myMap.events.register('mousemove', this, MouseMove);
where myMap is your OpenLayers.Map and MouseMove is your own function that
is called at every mouse movement.

Take a look here for the supported event types (of a map):
http://dev.openlayers.org/apidocs/files/OpenLayers/Map-js.html#OpenLayers.Map.EVENT_TYPES

I'm not OL expert so I don't give 100% certainty that these are the best
ways to go... they worked for me!
Piero
-- 
View this message in context: http://osgeo-org.1803224.n2.nabble.com/Capturing-mouse-events-tp5327630p5328664.html
Sent from the OpenLayers Users mailing list archive at Nabble.com.



More information about the Users mailing list