Change ol/control/ScaleLine getUnits return type
Remove `undefined` from the return type: the default value is 'metric'
This commit is contained in:
@@ -121,22 +121,19 @@ class ScaleLine extends Control {
|
|||||||
this, getChangeEventType(UNITS_PROP),
|
this, getChangeEventType(UNITS_PROP),
|
||||||
this.handleUnitsChanged_, this);
|
this.handleUnitsChanged_, this);
|
||||||
|
|
||||||
this.setUnits(/** @type {Units} */ (options.units) ||
|
this.setUnits(/** @type {Units} */ (options.units) || Units.METRIC);
|
||||||
Units.METRIC);
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Return the units to use in the scale line.
|
* Return the units to use in the scale line.
|
||||||
* @return {Units|undefined} The units
|
* @return {Units} The units
|
||||||
* to use in the scale line.
|
* to use in the scale line.
|
||||||
* @observable
|
* @observable
|
||||||
* @api
|
* @api
|
||||||
*/
|
*/
|
||||||
getUnits() {
|
getUnits() {
|
||||||
return (
|
return this.get(UNITS_PROP);
|
||||||
/** @type {Units|undefined} */ (this.get(UNITS_PROP))
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
Reference in New Issue
Block a user