Fix cruft on kml scale output

This commit is contained in:
Peter Robins
2016-03-16 15:12:23 +00:00
parent 44d0578389
commit 9ba4208616

View File

@@ -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);
};