mirror of
https://github.com/FoggedLens/iD.git
synced 2026-05-11 20:22:39 +02:00
3787185182
At z16 and below, tagged points are rendered with a small dot in the center. At z17 and above, they are rendered with a maki icon. See the test rendering page for examples. Fixes #381.
35 lines
1.2 KiB
JavaScript
35 lines
1.2 KiB
JavaScript
describe("iD.svg.Vertices", function () {
|
|
var surface,
|
|
projection = Object,
|
|
filter = d3.functor(true),
|
|
context;
|
|
|
|
beforeEach(function () {
|
|
context = iD();
|
|
surface = d3.select(document.createElementNS('http://www.w3.org/2000/svg', 'svg'))
|
|
.call(iD.svg.Surface());
|
|
});
|
|
|
|
it("adds tag classes", function () {
|
|
var node = iD.Node({tags: {highway: "traffic_signals"}, loc: [0, 0]}),
|
|
way = iD.Way({nodes: [node.id]}),
|
|
graph = iD.Graph([node, way]);
|
|
|
|
surface.call(iD.svg.Vertices(projection, context), graph, [node], filter);
|
|
|
|
expect(surface.select('.vertex')).to.be.classed('tag-highway');
|
|
expect(surface.select('.vertex')).to.be.classed('tag-highway-traffic_signals');
|
|
});
|
|
|
|
it("adds the .shared class to vertices that are members of two or more ways", function () {
|
|
var node = iD.Node({loc: [0, 0]}),
|
|
way1 = iD.Way({nodes: [node.id]}),
|
|
way2 = iD.Way({nodes: [node.id]}),
|
|
graph = iD.Graph([node, way1, way2]);
|
|
|
|
surface.call(iD.svg.Vertices(projection, context), graph, [node], filter);
|
|
|
|
expect(surface.select('.vertex')).to.be.classed('shared');
|
|
});
|
|
});
|