Rename minimumWidth to minWidth

This commit is contained in:
Tom Payne
2013-03-04 09:58:09 +01:00
parent f3d01dcbd3
commit c35d07d481
2 changed files with 5 additions and 6 deletions

View File

@@ -61,7 +61,7 @@
@exportObjectLiteral ol.control.ScaleLineOptions @exportObjectLiteral ol.control.ScaleLineOptions
@exportObjectLiteralProperty ol.control.ScaleLineOptions.map ol.Map|undefined @exportObjectLiteralProperty ol.control.ScaleLineOptions.map ol.Map|undefined
@exportObjectLiteralProperty ol.control.ScaleLineOptions.minimumWidth number|undefined @exportObjectLiteralProperty ol.control.ScaleLineOptions.minWidth number|undefined
@exportObjectLiteralProperty ol.control.ScaleLineOptions.target Element|undefined @exportObjectLiteralProperty ol.control.ScaleLineOptions.target Element|undefined
@exportObjectLiteralProperty ol.control.ScaleLineOptions.units ol.control.ScaleLineUnits|undefined @exportObjectLiteralProperty ol.control.ScaleLineOptions.units ol.control.ScaleLineUnits|undefined

View File

@@ -55,8 +55,7 @@ ol.control.ScaleLine = function(opt_options) {
* @private * @private
* @type {number} * @type {number}
*/ */
this.minimumWidth_ = goog.isDef(options.minimumWidth) ? this.minWidth_ = goog.isDef(options.minWidth) ? options.minWidth : 64;
options.minimumWidth : 64;
/** /**
* @private * @private
@@ -195,7 +194,7 @@ ol.control.ScaleLine.prototype.updateElement_ = function(frameState) {
} }
var nominalCount = this.minimumWidth_ * pointResolution; var nominalCount = this.minWidth_ * pointResolution;
var suffix = ''; var suffix = '';
if (this.units_ == ol.control.ScaleLineUnits.DEGREES) { if (this.units_ == ol.control.ScaleLineUnits.DEGREES) {
if (nominalCount < 1 / 60) { if (nominalCount < 1 / 60) {
@@ -247,13 +246,13 @@ ol.control.ScaleLine.prototype.updateElement_ = function(frameState) {
} }
var i = 3 * Math.floor( var i = 3 * Math.floor(
Math.log(this.minimumWidth_ * pointResolution) / Math.log(10)); Math.log(this.minWidth_ * pointResolution) / Math.log(10));
var count, width; var count, width;
while (true) { while (true) {
count = ol.control.ScaleLine.LEADING_DIGITS[i % 3] * count = ol.control.ScaleLine.LEADING_DIGITS[i % 3] *
Math.pow(10, Math.floor(i / 3)); Math.pow(10, Math.floor(i / 3));
width = Math.round(count / pointResolution); width = Math.round(count / pointResolution);
if (width >= this.minimumWidth_) { if (width >= this.minWidth_) {
break; break;
} }
++i; ++i;