From 5ae54133db606b30a67d48c853790cbcfeacd553 Mon Sep 17 00:00:00 2001 From: Tom Payne Date: Thu, 16 Jan 2014 19:45:23 +0100 Subject: [PATCH] Allow ol.format.KML.readNumber_ to read signs and exponents, thanks @tschaub --- src/ol/format/kmlformat.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/ol/format/kmlformat.js b/src/ol/format/kmlformat.js index b9946963da..29e1c93bfa 100644 --- a/src/ol/format/kmlformat.js +++ b/src/ol/format/kmlformat.js @@ -386,7 +386,7 @@ ol.format.KML.readFlatCoordinates_ = function(node) { */ ol.format.KML.readNumber_ = function(node) { var s = ol.xml.getAllTextContent(node, false); - var m = /^\s*(\d+(?:\.\d*)?)\s*$/.exec(s); + var m = /^\s*([+\-]?\d*\.?\d+(?:e[+\-]?\d+)?)\s*$/i.exec(s); if (m) { return parseFloat(m[1]); } else {