Add Node to control label type

This commit is contained in:
tsauerwein
2015-01-16 09:44:50 +01:00
parent 7679069520
commit fbb2883f6e
4 changed files with 90 additions and 61 deletions
+13 -3
View File
@@ -32,12 +32,22 @@ ol.control.Rotate = function(opt_options) {
var className = goog.isDef(options.className) ?
options.className : 'ol-rotate';
var label = goog.isDef(options.label) ?
options.label : '\u21E7';
/**
* @type {Element}
* @type {Node}
* @private
*/
this.label_ = goog.dom.createDom(goog.dom.TagName.SPAN,
'ol-compass', goog.isDef(options.label) ? options.label : '\u21E7');
this.label_ = null;
if (goog.isString(label)) {
this.label_ = goog.dom.createDom(goog.dom.TagName.SPAN,
'ol-compass', label);
} else {
this.label_ = label;
goog.dom.classlist.add(this.label_, 'ol-compass');
}
var tipLabel = goog.isDef(options.tipLabel) ?
options.tipLabel : 'Reset rotation';