Select to view content in your preferred language

Tooltips for navigation toolbar

1071
6
06-05-2013 12:58 PM
AllisonAnderson
Occasional Contributor
Is there any way to customize tooltips for the Navigation Toolbar?  You can for the Draw toolbar per this thread: http://forums.arcgis.com/threads/79780-change-draw-toolbar-tooltip-text-bad-documentation?highlight=...

And I saw the thread for customizing a general tooltip here: http://forums.arcgis.com/threads/51063-Customise-cursor-tooltip

But I'd really like to be able to customize tooltips for the various tools on the Nav toolbar.  Any ideas on the best way to go about it?
0 Kudos
6 Replies
DavideLimosani
Frequent Contributor
Is there any way to customize tooltips for the Navigation Toolbar?  You can for the Draw toolbar per this thread: http://forums.arcgis.com/threads/79780-change-draw-toolbar-tooltip-text-bad-documentation?highlight=...

And I saw the thread for customizing a general tooltip here: http://forums.arcgis.com/threads/51063-Customise-cursor-tooltip

But I'd really like to be able to customize tooltips for the various tools on the Nav toolbar.  Any ideas on the best way to go about it?


strarting from this sample

http://developers.arcgis.com/en/javascript/samples/toolbar_navigation/

you can add tooltips to the navigation toolbar using dijit.Tooltip

require(["dijit/Tooltip", "dojo/domReady!"], function(Tooltip){

      new Tooltip({
        connectId:["zoomin"],
        label:"Zoom in"
    });

   new Tooltip({
        connectId:["zoomout"],
        label:"Zoom out"
    });
});


source  http://dojotoolkit.org/reference-guide/1.9/dijit/Tooltip.html
0 Kudos
AllisonAnderson
Occasional Contributor
Thanks, I had looked at the dijit documentation, but it doesn't really do what I wanted.  I really want a tooltip that follows the cursor, similar to the draw toolbar tools.  I'll keep playing around with Derek's code sample in the link I posted.
0 Kudos
KenBuja
MVP Esteemed Contributor
Take a look at this post. Does that example do what you're looking for?
0 Kudos
AllisonAnderson
Occasional Contributor
Thanks Ken, but I'm not sure that helps.  The Draw toolbar has tooltips built in which you can customize, but there aren't any with the Navigation toolbar.  Unless I'm missing something.  I'm building a map for non-GIS map people, so to have a little descriptor would be nice.
0 Kudos
VinayBansal
Frequent Contributor
Yes, you are right ..you cannot add tooltip to navigation toolbar as it is not built in. In order to achieve that you need to build of your own. And since you need tooltip for navigation tool, i think there are only 2 tools for which you need tooltip (ZOOMIN and ZOOMOUT). Since only these 2 tools draw graphics on map. So you can use the capabilities of Draw Toolbar to build these 2 tools, and keep the rest same.
0 Kudos
GeoffreyJoseph1
Deactivated User
I ran into the same problem, here is what I did... I noticed the added class names, esriSimpleSliderIncrementButton and esriSimpleSliderDecrementButton by the widget, but alas no id attribute. Note, this example only shows the requires I used for the tooltips. There may be an easier way, I am very new to dojo, but it works.

require(["dojo/dom-attr","dojo/query"], function(domAttr,djQuery){

   navToolbar = new Navigation(map);
   // I put this after I initialized the toolbar
     
   var zoomInDiv = djQuery(".esriSimpleSliderIncrementButton");
   domAttr.set(zoomInDiv[0],"title","Zoom in");
     
   var zoomOutDiv = djQuery(".esriSimpleSliderDecrementButton");
   domAttr.set(zoomOutDiv[0],"title","Zoom out");

});
0 Kudos