[OpenLayers-Users] tooltips for Controls?

Eric Lemoine eric.c2c at gmail.com
Mon Jan 21 17:38:03 EST 2008


On Jan 21, 2008 10:33 PM, Gregor Mosheh <gregor at hostgis.com> wrote:
> This one sounded easer than it turned out to be. :)
>
> HTML elements can have a title attribute, and most browsers will show
> that text when the mouse hovers over the element.
>
> How may I apply this to OL Controls? I tried a few of the more obvious
> approaches, such as adding "this.div.title = 'Pan the map'" in
> initialize() but to no avail.
>
> Is this non-trivial to do? Is a 'title' param something that would be
> useful to add to Control itself for making a general solution to this?

I have used this for controls in a panel:

control1.panel_div.title = "title1";
control2.panel_div.title = "title2";

For this to work your map fallThrough property must be set to true.

Works on IE and FF.

Hope this helps,
--
Eric



More information about the Users mailing list