Return geometries rather than features in asGeoJSON

No code needs the tags, and it eliminates one level
of function calls in the d3 stream pipeline.
This commit is contained in:
John Firebaugh
2013-10-16 09:40:01 -04:00
parent 1374b5bc5d
commit 26e38d7f8f
6 changed files with 23 additions and 47 deletions
+3 -5
View File
@@ -78,14 +78,12 @@ describe('iD.Node', function () {
});
describe("#asGeoJSON", function () {
it("converts to a GeoJSON Point features", function () {
it("converts to a GeoJSON Point geometry", function () {
var node = iD.Node({tags: {amenity: 'cafe'}, loc: [1, 2]}),
json = node.asGeoJSON();
expect(json.type).to.equal('Feature');
expect(json.properties).to.eql({amenity: 'cafe'});
expect(json.geometry.type).to.equal('Point');
expect(json.geometry.coordinates).to.eql([1, 2]);
expect(json.type).to.equal('Point');
expect(json.coordinates).to.eql([1, 2]);
});
});
});