Merge pull request #8830 from fredj/misc

Type annotation fixes in ol/control/
This commit is contained in:
Frédéric Junod authored and GitHub committed 2018-10-17 13:26:05 +02:00
commit d2d041e54a
2 files changed
+4 -7

No files matched your search

+1 -1
View File
@@ -23,7 +23,7 @@ const COORDINATE_FORMAT = 'coordinateFormat';
* @typedef {Object} Options
* @property {string} [className='ol-mouse-position'] CSS class name.
* @property {import("../coordinate.js").CoordinateFormat} [coordinateFormat] Coordinate format.
* @property {import("../proj.js").ProjectionLike} projection Projection.
* @property {import("../proj.js").ProjectionLike} [projection] Projection. Default is the view projection.
* @property {function(import("../MapEvent.js").default)} [render] Function called when the
* control should be re-rendered. This is called in a `requestAnimationFrame`
* callback.
+3 -6
View File
@@ -121,22 +121,19 @@ class ScaleLine extends Control {
this, getChangeEventType(UNITS_PROP),
this.handleUnitsChanged_, this);
this.setUnits(/** @type {Units} */ (options.units) ||
Units.METRIC);
this.setUnits(/** @type {Units} */ (options.units) || Units.METRIC);
}
/**
* Return the units to use in the scale line.
* @return {Units|undefined} The units
* @return {Units} The units
* to use in the scale line.
* @observable
* @api
*/
getUnits() {
return (
/** @type {Units|undefined} */ (this.get(UNITS_PROP))
);
return this.get(UNITS_PROP);
}
/**