The writeFeatures method should always return a string
This commit is contained in:
@@ -465,7 +465,7 @@ describe('ol.format.GeoJSON', function() {
|
||||
it('encodes feature collection', function() {
|
||||
var str = JSON.stringify(data),
|
||||
array = format.readFeatures(str);
|
||||
var geojson = format.writeFeatures(array);
|
||||
var geojson = format.writeFeaturesObject(array);
|
||||
var result = format.readFeatures(geojson);
|
||||
expect(array.length).to.equal(result.length);
|
||||
var got, exp, gotProp, expProp;
|
||||
@@ -503,7 +503,7 @@ describe('ol.format.GeoJSON', function() {
|
||||
var feature = new ol.Feature({'foo': 'bar'});
|
||||
feature.setGeometryName('mygeom');
|
||||
feature.setGeometry(new ol.geom.Point([5, 10]));
|
||||
var geojson = format.writeFeatures([feature]);
|
||||
var geojson = format.writeFeaturesObject([feature]);
|
||||
expect(geojson.features[0].properties.mygeom).to.eql(undefined);
|
||||
});
|
||||
|
||||
@@ -555,7 +555,7 @@ describe('ol.format.GeoJSON', function() {
|
||||
|
||||
it('encodes a circle as an empty geometry collection', function() {
|
||||
var circle = new ol.geom.Circle([0, 0], 1);
|
||||
var geojson = format.writeGeometry(circle);
|
||||
var geojson = format.writeGeometryObject(circle);
|
||||
expect(geojson).to.eql({
|
||||
'type': 'GeometryCollection',
|
||||
'geometries': []
|
||||
|
||||
Reference in New Issue
Block a user