Better type annotations / type casts
This commit is contained in:
@@ -101,6 +101,7 @@ class Feature extends BaseObject {
|
|||||||
if (opt_geometryOrProperties !== undefined) {
|
if (opt_geometryOrProperties !== undefined) {
|
||||||
if (opt_geometryOrProperties instanceof Geometry ||
|
if (opt_geometryOrProperties instanceof Geometry ||
|
||||||
!opt_geometryOrProperties) {
|
!opt_geometryOrProperties) {
|
||||||
|
/** @type {?Geometry} */
|
||||||
const geometry = opt_geometryOrProperties;
|
const geometry = opt_geometryOrProperties;
|
||||||
this.setGeometry(geometry);
|
this.setGeometry(geometry);
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
@@ -26,9 +26,9 @@ class MultiPoint extends SimpleGeometry {
|
|||||||
constructor(coordinates, opt_layout) {
|
constructor(coordinates, opt_layout) {
|
||||||
super();
|
super();
|
||||||
if (opt_layout && !Array.isArray(coordinates[0])) {
|
if (opt_layout && !Array.isArray(coordinates[0])) {
|
||||||
this.setFlatCoordinates(opt_layout, coordinates);
|
this.setFlatCoordinates(opt_layout, /** @type {Array<number>} */ (coordinates));
|
||||||
} else {
|
} else {
|
||||||
this.setCoordinates(coordinates, opt_layout);
|
this.setCoordinates(/** @type {Array<import("../coordinate.js").Coordinate>} */ (coordinates), opt_layout);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user