[OpenLayers-Users] tooltips for Controls?

Linda Rawson linda.rawson at gmail.com
Mon Jan 21 17:16:00 EST 2008


I did this in the

redraw:
method of the panel.js itself with the following lines but it is a total
hack and only for my application:

var ctrlName = this.controls[i].CLASS_NAME.replace("OpenLayers.",
"").replace("Control.","");
var title = null;

if (ctrlName == "ZoomBox") {
  title = "Zoom to Location";
};
if (title != null) {
  element.title = title;
}
this.div.appendChild(element);
A title would be great as well as the ability to hide/show a control.

My understanding is that this title attribute is only good in IE.

Linda Rawson
On Jan 21, 2008 2: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?
>
> --
> Gregor Mosheh / Greg Allensworth, BS, A+
> System Administrator
> HostGIS cartographic development & hosting services
> http://www.HostGIS.com/ <http://www.hostgis.com/>
>
> "Remember that no one cares if you can back up,
>  only if you can restore." - AMANDA
> _______________________________________________
> Users mailing list
> Users at openlayers.org
> http://openlayers.org/mailman/listinfo/users
>



-- 
Linda Rawson
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.osgeo.org/pipermail/openlayers-users/attachments/20080121/de02420c/attachment.html


More information about the Users mailing list