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:
@@ -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);
|
||||
});
|
||||
});
|
||||
|
||||
});
|
||||
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user