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} 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} 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} 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 {number|undefined} delta The zoom delta applied on each click.
|
||||||
* @property {Element|undefined} target Target.
|
* @property {Element|undefined} target Target.
|
||||||
* @todo stability experimental
|
* @todo stability experimental
|
||||||
|
|||||||
@@ -37,10 +37,15 @@ ol.control.Zoom = function(opt_options) {
|
|||||||
var zoomOutLabel = goog.isDef(options.zoomOutLabel) ?
|
var zoomOutLabel = goog.isDef(options.zoomOutLabel) ?
|
||||||
options.zoomOutLabel : '\u2212';
|
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, {
|
var tTipZoomIn = goog.dom.createDom(goog.dom.TagName.SPAN, {
|
||||||
'class': '',
|
'class': '',
|
||||||
'role' : 'tooltip'
|
'role' : 'tooltip'
|
||||||
}, 'Zoom in');
|
}, zoomInTipLabel);
|
||||||
var inElement = goog.dom.createDom(goog.dom.TagName.BUTTON, {
|
var inElement = goog.dom.createDom(goog.dom.TagName.BUTTON, {
|
||||||
'class': className + '-in olHasToolTip',
|
'class': className + '-in olHasToolTip',
|
||||||
'name' : 'ZoomIn',
|
'name' : 'ZoomIn',
|
||||||
@@ -56,7 +61,7 @@ ol.control.Zoom = function(opt_options) {
|
|||||||
'class': '',
|
'class': '',
|
||||||
'role' : 'tooltip',
|
'role' : 'tooltip',
|
||||||
'type' : 'button'
|
'type' : 'button'
|
||||||
}, 'Zoom out');
|
}, zoomOutTipLabel);
|
||||||
var outElement = goog.dom.createDom(goog.dom.TagName.BUTTON, {
|
var outElement = goog.dom.createDom(goog.dom.TagName.BUTTON, {
|
||||||
'class': className + '-out olHasToolTip',
|
'class': className + '-out olHasToolTip',
|
||||||
'name' : 'ZoomOut'
|
'name' : 'ZoomOut'
|
||||||
|
|||||||
Reference in New Issue
Block a user