diff --git a/css/ol.css b/css/ol.css index 44ea0f35e9..6672d9e46d 100644 --- a/css/ol.css +++ b/css/ol.css @@ -114,9 +114,6 @@ background-color: #4c6079; background-color: rgba(0,60,136,0.7); } -.ol-zoom-extent button:after { - content: "E"; -} .ol-zoom .ol-zoom-in { border-radius: 2px 2px 0 0; } diff --git a/externs/olx.js b/externs/olx.js index 5e76abf33b..8a47680672 100644 --- a/externs/olx.js +++ b/externs/olx.js @@ -1409,6 +1409,7 @@ olx.control.ZoomSliderOptions.prototype.render; /** * @typedef {{className: (string|undefined), * target: (Element|undefined), + * label: (string|undefined), * tipLabel: (string|undefined), * extent: (ol.Extent|undefined)}} * @api stable @@ -1432,6 +1433,14 @@ olx.control.ZoomToExtentOptions.prototype.className; olx.control.ZoomToExtentOptions.prototype.target; +/** + * Text label to use for the button. Default is `E` + * @type {string|undefined} + * @api stable + */ +olx.control.ZoomToExtentOptions.prototype.label; + + /** * Text label to use for the button tip. Default is `Zoom to extent` * @type {string|undefined} diff --git a/src/ol/control/zoomtoextentcontrol.js b/src/ol/control/zoomtoextentcontrol.js index 0af782407d..1c592c7ec0 100644 --- a/src/ol/control/zoomtoextentcontrol.js +++ b/src/ol/control/zoomtoextentcontrol.js @@ -32,12 +32,14 @@ ol.control.ZoomToExtent = function(opt_options) { var className = goog.isDef(options.className) ? options.className : 'ol-zoom-extent'; + var label = goog.isDef(options.label) ? + options.label : 'E'; var tipLabel = goog.isDef(options.tipLabel) ? options.tipLabel : 'Fit to extent'; var button = goog.dom.createDom(goog.dom.TagName.BUTTON, { 'type': 'button', 'title': tipLabel - }); + }, label); goog.events.listen(button, goog.events.EventType.CLICK, this.handleClick_, false, this);