Remove goog.style.setElementShown
This commit is contained in:
@@ -4,7 +4,6 @@ goog.provide('ol.control.ScaleLineUnits');
|
||||
|
||||
goog.require('goog.asserts');
|
||||
goog.require('ol.events');
|
||||
goog.require('goog.style');
|
||||
goog.require('ol');
|
||||
goog.require('ol.Object');
|
||||
goog.require('ol.control.Control');
|
||||
@@ -183,7 +182,7 @@ ol.control.ScaleLine.prototype.updateElement_ = function() {
|
||||
|
||||
if (!viewState) {
|
||||
if (this.renderedVisible_) {
|
||||
goog.style.setElementShown(this.element_, false);
|
||||
this.element_.style.display = 'none';
|
||||
this.renderedVisible_ = false;
|
||||
}
|
||||
return;
|
||||
@@ -258,7 +257,7 @@ ol.control.ScaleLine.prototype.updateElement_ = function() {
|
||||
Math.pow(10, Math.floor(i / 3));
|
||||
width = Math.round(count / pointResolution);
|
||||
if (isNaN(width)) {
|
||||
goog.style.setElementShown(this.element_, false);
|
||||
this.element_.style.display = 'none'; // Hide the element
|
||||
this.renderedVisible_ = false;
|
||||
return;
|
||||
} else if (width >= this.minWidth_) {
|
||||
@@ -279,7 +278,7 @@ ol.control.ScaleLine.prototype.updateElement_ = function() {
|
||||
}
|
||||
|
||||
if (!this.renderedVisible_) {
|
||||
goog.style.setElementShown(this.element_, true);
|
||||
this.element_.style.display = ''; //Show the element
|
||||
this.renderedVisible_ = true;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user