From bc8f0252a718512a2ef6b4ae0b19b98ec863e4f8 Mon Sep 17 00:00:00 2001 From: Andreas Hocevar Date: Thu, 12 Nov 2020 11:34:18 +0100 Subject: [PATCH] Add test for when neither dataProjection nor featureProjection are set --- test/spec/ol/format/esrijson.test.js | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/test/spec/ol/format/esrijson.test.js b/test/spec/ol/format/esrijson.test.js index 76eb1db46c..2af41df4c5 100644 --- a/test/spec/ol/format/esrijson.test.js +++ b/test/spec/ol/format/esrijson.test.js @@ -1797,5 +1797,17 @@ describe('ol.format.EsriJSON', function () { ); }); }); + + it('does not add the projection inside the geometry when neither featurProjection nor dataProjection are set', function () { + const str = JSON.stringify(data); + const array = format.readFeatures(str); + const esrijson = format.writeFeaturesObject(array); + esrijson.features.forEach(function (feature, i) { + expect(feature.geometry.spatialReference).to.be(undefined); + expect(feature.geometry.paths[0]).to.eql( + array[i].getGeometry().getCoordinates() + ); + }); + }); }); });