From e9baa2cfc4b15dff2573d21645cbdb8eafe2501d Mon Sep 17 00:00:00 2001 From: Kevin Schmidt Date: Tue, 25 Sep 2018 13:03:43 -0600 Subject: [PATCH] Fix TypeScript errors in ol/format/Feature --- src/ol/format/Feature.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/ol/format/Feature.js b/src/ol/format/Feature.js index 43de34c49c..e3386d33b6 100644 --- a/src/ol/format/Feature.js +++ b/src/ol/format/Feature.js @@ -229,8 +229,9 @@ export function transformWithOptions(geometry, write, opt_options) { } else { transformed = geometry; } - if (write && opt_options && opt_options.decimals !== undefined) { - const power = Math.pow(10, opt_options.decimals); + if (write && opt_options && /** @type {WriteOptions} */ (opt_options).decimals !== undefined && + transformed instanceof Geometry) { + const power = Math.pow(10, /** @type {WriteOptions} */ (opt_options).decimals); // if decimals option on write, round each coordinate appropriately /** * @param {Array} coordinates Coordinates.