diff --git a/src/ol/format/kmlformat.js b/src/ol/format/kmlformat.js index 936ae8b294..f7cc7fe3d9 100644 --- a/src/ol/format/kmlformat.js +++ b/src/ol/format/kmlformat.js @@ -2484,7 +2484,9 @@ ol.format.KML.writePolyStyle_ = function(node, style, objectStack) { * @private */ ol.format.KML.writeScaleTextNode_ = function(node, scale) { - ol.format.XSD.writeDecimalTextNode(node, scale * scale); + // the Math is to remove any excess decimals created by float arithmetic + ol.format.XSD.writeDecimalTextNode(node, + Math.round(scale * scale * 1e6) / 1e6); };