Allow ol.format.KML.readNumber_ to read signs and exponents, thanks @tschaub

This commit is contained in:
Tom Payne
2014-01-16 19:45:23 +01:00
parent 92b852c512
commit 5ae54133db

View File

@@ -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 {