[OpenLayers-Users] Tooltip

Gregor Mosheh gregor at hostgis.com
Fri Mar 28 08:21:40 EDT 2008


Gérald Quintana wrote:
> Is it possible to display a tooltip when the mouse stops moving over the map?

I posted my responses a few weeks ago, along with some working code. 
Check the archives and ask again if you can't find it.

The basic outline is:
- add a mousemove handler to the map object
- the event handler saves the event to a variable, and does a 
clearTimeout() and setTimeout() to keep from firing the handler a 
zillion times when someone sneezes
- the timeout's handler reads the variable and does basically the same 
as you would for a click event

As far as I could tell, the map itself didn't have a hover event, that 
was only for vector objects. If I'm wrong about that and the map does 
have a hover event, I'd love to be corrected because that could simplify 
my approach significantly.

-- 
Gregor Mosheh / Greg Allensworth, BS, A+
System Administrator
HostGIS cartographic development & hosting services
http://www.HostGIS.com/

"Remember that no one cares if you can back up,
  only if you can restore." - AMANDA



More information about the Users mailing list