Adds unit test to test the projection inside the geometry of esriJson

This adds a unit test that tests weather the projection (spatial reference)
is being added inside the geometry object when writing features as
esriJson.
This commit is contained in:
Joao Gouveia
2017-08-17 11:21:33 +02:00
parent 44558b7c89
commit a0b76a5604

View File

@@ -1063,6 +1063,18 @@ describe('ol.format.EsriJSON', function() {
expect(esrijson.attributes).to.eql({});
});
it('adds the projection inside the geometry correctly', function() {
var str = JSON.stringify(data);
var array = format.readFeatures(str);
var esrijson = format.writeFeaturesObject(array, {
featureProjection: 'EPSG:4326'
});
esrijson.features.forEach(function(feature) {
var spatialReference = feature.geometry.spatialReference;
expect(Number(spatialReference.wkid)).to.equal(4326);
});
});
});
});