Fix TypeScript errors in ol/format/Feature

This commit is contained in:
Kevin Schmidt
2018-09-25 13:03:43 -06:00
parent be12573883
commit e9baa2cfc4

View File

@@ -229,8 +229,9 @@ export function transformWithOptions(geometry, write, opt_options) {
} else { } else {
transformed = geometry; transformed = geometry;
} }
if (write && opt_options && opt_options.decimals !== undefined) { if (write && opt_options && /** @type {WriteOptions} */ (opt_options).decimals !== undefined &&
const power = Math.pow(10, opt_options.decimals); transformed instanceof Geometry) {
const power = Math.pow(10, /** @type {WriteOptions} */ (opt_options).decimals);
// if decimals option on write, round each coordinate appropriately // if decimals option on write, round each coordinate appropriately
/** /**
* @param {Array<number>} coordinates Coordinates. * @param {Array<number>} coordinates Coordinates.