mirror of
https://github.com/FoggedLens/iD.git
synced 2026-05-26 01:47:49 +02:00
5ea855e18d
Having two kinds of Ways (fetched and non-fetched) introduced some accidental complexity. This brings things more in line with how parentWays/parentRelations work. Fixes #73.
18 lines
630 B
JavaScript
18 lines
630 B
JavaScript
describe('iD.format.GeoJSON', function() {
|
|
describe('#mapping', function() {
|
|
it('converts a node to GeoJSON', function() {
|
|
var node = iD.Node({loc: [-77, 38]}),
|
|
graph = iD.Graph([node]);
|
|
expect(iD.format.GeoJSON.mapping(node, graph).geometry.type).to.equal('Point');
|
|
});
|
|
|
|
it('converts a way to GeoJSON', function() {
|
|
var way = iD.Way(),
|
|
graph = iD.Graph([way]),
|
|
json = iD.format.GeoJSON.mapping(way, graph);
|
|
expect(json.type).to.equal('Feature');
|
|
expect(json.geometry.type).to.equal('LineString');
|
|
});
|
|
});
|
|
});
|