Remove unnecessary typecast
Remove typecast where typescript is able to correctly deduce the type.
This commit is contained in:
@@ -539,8 +539,7 @@ class PluggableMap extends BaseObject {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
const coordinate = this.getCoordinateFromPixelInternal(pixel);
|
const coordinate = this.getCoordinateFromPixelInternal(pixel);
|
||||||
opt_options = opt_options !== undefined ? opt_options :
|
opt_options = opt_options !== undefined ? opt_options : {};
|
||||||
/** @type {AtPixelOptions} */ ({});
|
|
||||||
const hitTolerance = opt_options.hitTolerance !== undefined ?
|
const hitTolerance = opt_options.hitTolerance !== undefined ?
|
||||||
opt_options.hitTolerance * this.frameState_.pixelRatio : 0;
|
opt_options.hitTolerance * this.frameState_.pixelRatio : 0;
|
||||||
const layerFilter = opt_options.layerFilter !== undefined ?
|
const layerFilter = opt_options.layerFilter !== undefined ?
|
||||||
@@ -592,7 +591,7 @@ class PluggableMap extends BaseObject {
|
|||||||
if (!this.frameState_) {
|
if (!this.frameState_) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
const options = opt_options || /** @type {AtPixelOptions} */ ({});
|
const options = opt_options || {};
|
||||||
const hitTolerance = options.hitTolerance !== undefined ?
|
const hitTolerance = options.hitTolerance !== undefined ?
|
||||||
options.hitTolerance * this.frameState_.pixelRatio : 0;
|
options.hitTolerance * this.frameState_.pixelRatio : 0;
|
||||||
const layerFilter = options.layerFilter || TRUE;
|
const layerFilter = options.layerFilter || TRUE;
|
||||||
@@ -612,8 +611,7 @@ class PluggableMap extends BaseObject {
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
const coordinate = this.getCoordinateFromPixelInternal(pixel);
|
const coordinate = this.getCoordinateFromPixelInternal(pixel);
|
||||||
opt_options = opt_options !== undefined ? opt_options :
|
opt_options = opt_options !== undefined ? opt_options : {};
|
||||||
/** @type {AtPixelOptions} */ ({});
|
|
||||||
const layerFilter = opt_options.layerFilter !== undefined ? opt_options.layerFilter : TRUE;
|
const layerFilter = opt_options.layerFilter !== undefined ? opt_options.layerFilter : TRUE;
|
||||||
const hitTolerance = opt_options.hitTolerance !== undefined ?
|
const hitTolerance = opt_options.hitTolerance !== undefined ?
|
||||||
opt_options.hitTolerance * this.frameState_.pixelRatio : 0;
|
opt_options.hitTolerance * this.frameState_.pixelRatio : 0;
|
||||||
|
|||||||
@@ -126,7 +126,7 @@ class ScaleLine extends Control {
|
|||||||
|
|
||||||
this.addEventListener(getChangeEventType(UNITS_PROP), this.handleUnitsChanged_);
|
this.addEventListener(getChangeEventType(UNITS_PROP), this.handleUnitsChanged_);
|
||||||
|
|
||||||
this.setUnits(/** @type {Units} */ (options.units) || Units.METRIC);
|
this.setUnits(options.units || Units.METRIC);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @private
|
* @private
|
||||||
|
|||||||
+1
-1
@@ -70,7 +70,7 @@ export function toSize(size, opt_size) {
|
|||||||
if (opt_size === undefined) {
|
if (opt_size === undefined) {
|
||||||
opt_size = [size, size];
|
opt_size = [size, size];
|
||||||
} else {
|
} else {
|
||||||
opt_size[0] = opt_size[1] = /** @type {number} */ (size);
|
opt_size[0] = opt_size[1] = size;
|
||||||
}
|
}
|
||||||
return opt_size;
|
return opt_size;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -98,8 +98,7 @@ class RegularShape extends ImageStyle {
|
|||||||
* @protected
|
* @protected
|
||||||
* @type {number}
|
* @type {number}
|
||||||
*/
|
*/
|
||||||
this.radius_ = /** @type {number} */ (options.radius !== undefined ?
|
this.radius_ = options.radius !== undefined ? options.radius : options.radius1;
|
||||||
options.radius : options.radius1);
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @private
|
* @private
|
||||||
|
|||||||
@@ -88,12 +88,10 @@ export function createForExtent(extent, opt_maxZoom, opt_tileSize, opt_corner) {
|
|||||||
* @api
|
* @api
|
||||||
*/
|
*/
|
||||||
export function createXYZ(opt_options) {
|
export function createXYZ(opt_options) {
|
||||||
/** @type {XYZOptions} */
|
|
||||||
const xyzOptions = opt_options || {};
|
const xyzOptions = opt_options || {};
|
||||||
|
|
||||||
const extent = xyzOptions.extent || getProjection('EPSG:3857').getExtent();
|
const extent = xyzOptions.extent || getProjection('EPSG:3857').getExtent();
|
||||||
|
|
||||||
/** @type {import("./tilegrid/TileGrid.js").Options} */
|
|
||||||
const gridOptions = {
|
const gridOptions = {
|
||||||
extent: extent,
|
extent: extent,
|
||||||
minZoom: xyzOptions.minZoom,
|
minZoom: xyzOptions.minZoom,
|
||||||
|
|||||||
Reference in New Issue
Block a user