The writeFeatures method should always return a string

This commit is contained in:
Bart van den Eijnden
2014-12-04 16:58:52 +01:00
parent dfb55fb6a5
commit 3587418888
13 changed files with 174 additions and 102 deletions

View File

@@ -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': []