Add className option to ol.control.ScaleLine

This commit is contained in:
Tom Payne
2013-05-07 16:19:21 +02:00
parent f31a4f8549
commit 09feaedd00
2 changed files with 6 additions and 2 deletions

View File

@@ -148,6 +148,7 @@
/**
* @typedef {Object} ol.control.ScaleLineOptions
* @property {string|undefined} className Class name.
* @property {ol.Map|undefined} map Map.
* @property {number|undefined} minWidth Minimum width in pixels.
* @property {Element|undefined} target Target.

View File

@@ -38,12 +38,15 @@ ol.control.ScaleLine = function(opt_options) {
var options = opt_options || {};
var className = goog.isDef(options.className) ?
options.className : 'ol-scale-line';
/**
* @private
* @type {Element}
*/
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}
*/
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_);
/**