Apply tag classes to vertices and points

While here, introduce a `classed` matcher for Chai.
This commit is contained in:
John Firebaugh
2013-01-11 12:22:23 -08:00
parent 577398ca21
commit e95d163dbc
7 changed files with 54 additions and 4 deletions
+3 -2
View File
@@ -8,7 +8,7 @@ iD.svg.Points = function() {
}
}
return 'icons/unknown.png';
};
}
return function(surface, graph, entities, filter, projection) {
var points = [];
@@ -40,7 +40,8 @@ iD.svg.Points = function() {
.attr({ width: 16, height: 16 })
.attr('transform', 'translate(-8, -8)');
groups.attr('transform', iD.svg.PointTransform(projection));
groups.attr('transform', iD.svg.PointTransform(projection))
.call(iD.svg.TagClasses());
// Selecting the following implicitly
// sets the data (point entity) on the element
+1
View File
@@ -26,6 +26,7 @@ iD.svg.Vertices = function() {
.attr('r', 4);
groups.attr('transform', iD.svg.PointTransform(projection))
.call(iD.svg.TagClasses())
.classed('shared', function(entity) { return graph.parentWays(entity).length > 1; });
// Selecting the following implicitly