Merge pull request #5055 from probins/kmlscalecruft

Fix cruft on kml scale output
This commit is contained in:
Andreas Hocevar
2016-03-16 16:34:01 +01:00

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