Add className option to ol.control.ScaleLine
This commit is contained in:
@@ -148,6 +148,7 @@
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @typedef {Object} ol.control.ScaleLineOptions
|
* @typedef {Object} ol.control.ScaleLineOptions
|
||||||
|
* @property {string|undefined} className Class name.
|
||||||
* @property {ol.Map|undefined} map Map.
|
* @property {ol.Map|undefined} map Map.
|
||||||
* @property {number|undefined} minWidth Minimum width in pixels.
|
* @property {number|undefined} minWidth Minimum width in pixels.
|
||||||
* @property {Element|undefined} target Target.
|
* @property {Element|undefined} target Target.
|
||||||
|
|||||||
@@ -38,12 +38,15 @@ ol.control.ScaleLine = function(opt_options) {
|
|||||||
|
|
||||||
var options = opt_options || {};
|
var options = opt_options || {};
|
||||||
|
|
||||||
|
var className = goog.isDef(options.className) ?
|
||||||
|
options.className : 'ol-scale-line';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @private
|
* @private
|
||||||
* @type {Element}
|
* @type {Element}
|
||||||
*/
|
*/
|
||||||
this.innerElement_ = goog.dom.createDom(goog.dom.TagName.DIV, {
|
this.innerElement_ = goog.dom.createDom(goog.dom.TagName.DIV, {
|
||||||
'class': 'ol-scale-line-inner'
|
'class': className + '-inner'
|
||||||
});
|
});
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -51,7 +54,7 @@ ol.control.ScaleLine = function(opt_options) {
|
|||||||
* @type {Element}
|
* @type {Element}
|
||||||
*/
|
*/
|
||||||
this.element_ = goog.dom.createDom(goog.dom.TagName.DIV, {
|
this.element_ = goog.dom.createDom(goog.dom.TagName.DIV, {
|
||||||
'class': 'ol-scale-line ' + ol.css.CLASS_UNSELECTABLE
|
'class': className + ' ' + ol.css.CLASS_UNSELECTABLE
|
||||||
}, this.innerElement_);
|
}, this.innerElement_);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
Reference in New Issue
Block a user