diff --git a/test/spec/ol/format/kml/style.kml b/test/spec/ol/format/kml/style.kml new file mode 100644 index 0000000000..fb118786f1 --- /dev/null +++ b/test/spec/ol/format/kml/style.kml @@ -0,0 +1,37 @@ + + + Drawing + + + + 7.282103855735575,47.252335388740185 7.286372432423239,47.23794977574282 7.353199702540651,47.23711986131712 7.287223923345992,47.26352553438413 + + + + + + + + 7.227134983319887,47.25587491183515 7.23801833800725,47.242582453518516 7.260803078150167,47.2619584739595 7.239912047946697,47.265971706882716 7.227134983319887,47.25587491183515 + + + + + + \ No newline at end of file diff --git a/test/spec/ol/format/kmlformat.test.js b/test/spec/ol/format/kmlformat.test.js index adaaef5c18..f1262746d7 100644 --- a/test/spec/ol/format/kmlformat.test.js +++ b/test/spec/ol/format/kmlformat.test.js @@ -2474,6 +2474,31 @@ describe('ol.format.KML', function() { }); + describe('#JSONExport', function() { + + var features; + before(function(done) { + afterLoadText('spec/ol/format/kml/style.kml', function(xml) { + try { + features = format.readFeatures(xml); + } catch (e) { + done(e); + } + done(); + }); + }); + + it('feature must not have a properties property', function() { + var geojsonFormat = new ol.format.GeoJSON(); + features.forEach(function(feature) { + var geojsonFeature = geojsonFormat.writeFeatureObject(feature); + expect(geojsonFeature.properties).to.be(null); + JSON.stringify(geojsonFeature); + }); + }); + + }); + describe('#readName', function() { it('returns undefined if there is no name', function() { @@ -2578,6 +2603,7 @@ describe('ol.format.KML', function() { goog.require('goog.array'); goog.require('goog.dom.xml'); goog.require('ol.Feature'); +goog.require('ol.format.GeoJSON'); goog.require('ol.format.KML'); goog.require('ol.geom.GeometryCollection'); goog.require('ol.geom.GeometryLayout');