Make zoom control tip texts configurable
This commit is contained in:
@@ -256,6 +256,8 @@
|
||||
* @property {string|undefined} className CSS class name. Default is `ol-zoom`.
|
||||
* @property {string|undefined} zoomInLabel Text label to use for the zoom-in button. Default is `+`
|
||||
* @property {string|undefined} zoomOutLabel Text label to use for the zoom-out button. Default is `-`
|
||||
* @property {string|undefined} zoomInTipLabel Text label to use for the zoom-in tip. Default is `Zoom in`
|
||||
* @property {string|undefined} zoomOutTipLabel Text label to use for the zoom-out tip. Default is `Zoom out`
|
||||
* @property {number|undefined} delta The zoom delta applied on each click.
|
||||
* @property {Element|undefined} target Target.
|
||||
* @todo stability experimental
|
||||
|
||||
@@ -37,10 +37,15 @@ ol.control.Zoom = function(opt_options) {
|
||||
var zoomOutLabel = goog.isDef(options.zoomOutLabel) ?
|
||||
options.zoomOutLabel : '\u2212';
|
||||
|
||||
var zoomInTipLabel = goog.isDef(options.zoomTipLabel) ?
|
||||
options.zoomInTipLabel : 'Zoom in';
|
||||
var zoomOutTipLabel = goog.isDef(options.zoomOutTipLabel) ?
|
||||
options.zoomOutTipLabel : 'Zoom out';
|
||||
|
||||
var tTipZoomIn = goog.dom.createDom(goog.dom.TagName.SPAN, {
|
||||
'class': '',
|
||||
'role' : 'tooltip'
|
||||
}, 'Zoom in');
|
||||
}, zoomInTipLabel);
|
||||
var inElement = goog.dom.createDom(goog.dom.TagName.BUTTON, {
|
||||
'class': className + '-in olHasToolTip',
|
||||
'name' : 'ZoomIn',
|
||||
@@ -56,7 +61,7 @@ ol.control.Zoom = function(opt_options) {
|
||||
'class': '',
|
||||
'role' : 'tooltip',
|
||||
'type' : 'button'
|
||||
}, 'Zoom out');
|
||||
}, zoomOutTipLabel);
|
||||
var outElement = goog.dom.createDom(goog.dom.TagName.BUTTON, {
|
||||
'class': className + '-out olHasToolTip',
|
||||
'name' : 'ZoomOut'
|
||||
|
||||
Reference in New Issue
Block a user