mirror of
https://github.com/FoggedLens/iD.git
synced 2026-06-04 22:18:06 +02:00
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:
@@ -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]);
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user