@@ -148,6 +148,7 @@ class Navigation extends Widget {
148
148
this . compass = this . addButton (
149
149
'compass' ,
150
150
'' ,
151
+ 'Rotate the camera to face North' ,
151
152
this . onClick . compass ,
152
153
'widgets' ,
153
154
) ;
@@ -163,6 +164,7 @@ class Navigation extends Widget {
163
164
this . switch3dButton = this . addButton (
164
165
'3d-button' ,
165
166
'3D' ,
167
+ 'Tilt the camera' ,
166
168
this . onClick . toggle3D ,
167
169
) ;
168
170
@@ -177,6 +179,7 @@ class Navigation extends Widget {
177
179
this . zoomInButton = this . addButton (
178
180
'zoom-in-button' ,
179
181
'<span class="widget-zoom-button-logo"></span>' ,
182
+ 'Zoom in' ,
180
183
this . onClick . zoomIn ,
181
184
'zoom-button-bar' ,
182
185
) ;
@@ -187,6 +190,7 @@ class Navigation extends Widget {
187
190
this . zoomOutButton = this . addButton (
188
191
'zoom-out-button' ,
189
192
'<span id="zoom-out-logo" class="widget-zoom-button-logo"></span>' ,
193
+ 'Zoom out' ,
190
194
this . onClick . zoomOut ,
191
195
'zoom-button-bar' ,
192
196
) ;
@@ -197,6 +201,8 @@ class Navigation extends Widget {
197
201
*
198
202
* @param {string } id The unique id the created button should be given.
199
203
* @param {string } [content=''] An HTML string defining the content of the button.
204
+ * @param {string } [info=''] An HTML string defining information on the button. This string will be
205
+ * displayed in a tooltip when hovering the button.
200
206
* @param {function } [actionOnClick] The method that should be executed when the button is clicked on.
201
207
* @param {string } [parentId] The unique id of a button bar in which the created button should be added.
202
208
* A button bar is a group which contains one or several buttons. All
@@ -210,6 +216,7 @@ class Navigation extends Widget {
210
216
addButton (
211
217
id ,
212
218
content = '' ,
219
+ info = '' ,
213
220
actionOnClick = ( ) => { } ,
214
221
parentId ,
215
222
) {
@@ -222,6 +229,7 @@ class Navigation extends Widget {
222
229
button . className = 'widget-button' ;
223
230
button . id = id ;
224
231
button . innerHTML = content ;
232
+ button . title = info ;
225
233
226
234
buttonBar . appendChild ( button ) ;
227
235
0 commit comments