diff --git a/src/ol/format/gmlformat.js b/src/ol/format/gmlformat.js index 8df6e5f05a..9f7e2dc6d9 100644 --- a/src/ol/format/gmlformat.js +++ b/src/ol/format/gmlformat.js @@ -699,7 +699,7 @@ ol.format.GML.readFlatCoordinatesFromNode_ = function(node, objectStack) { */ ol.format.GML.readFlatPos_ = function(node, objectStack) { var s = ol.xml.getAllTextContent(node, false); - var re = /^\s*([+\-]?\d*\.?\d+(?:e[+\-]?\d+)?)\s*/; + var re = /^\s*([+\-]?\d*\.?\d+(?:[eE][+\-]?\d+)?)\s*/; /** @type {Array.} */ var flatCoordinates = []; var m; diff --git a/test/spec/ol/format/gmlformat.test.js b/test/spec/ol/format/gmlformat.test.js index 143e846ade..05fcd09388 100644 --- a/test/spec/ol/format/gmlformat.test.js +++ b/test/spec/ol/format/gmlformat.test.js @@ -34,6 +34,25 @@ describe('ol.format.GML', function() { expect(serialized.firstElementChild).to.xmleql(ol.xml.load(text)); }); + it('can read a point geometry with scientific notation', function() { + var text = + '' + + ' 1E7 2' + + ''; + var g = readGeometry(format, text); + expect(g).to.be.an(ol.geom.Point); + expect(g.getCoordinates()).to.eql([10000000, 2, 0]); + text = + '' + + ' 1e7 2' + + ''; + g = readGeometry(format, text); + expect(g).to.be.an(ol.geom.Point); + expect(g.getCoordinates()).to.eql([10000000, 2, 0]); + }); + it('can read, transform and write a point geometry', function() { var config = { featureProjection: 'EPSG:3857'