mirror of
https://github.com/FoggedLens/iD.git
synced 2026-03-31 01:09:22 +02:00
Render directional points (e.g. benches, cameras, signs) as vertices
This commit is contained in:
@@ -99,7 +99,7 @@ _extend(osmNode.prototype, {
|
||||
var lookForward =
|
||||
(this.tags['traffic_sign:forward'] || val === 'forward' || val === 'both' || val === 'all');
|
||||
|
||||
if (!lookForward && !lookBackward) return null;
|
||||
if (!lookForward && !lookBackward) return [];
|
||||
|
||||
var nodeIds = {};
|
||||
resolver.parentWays(this).forEach(function(parent) {
|
||||
|
||||
@@ -22,7 +22,7 @@ export function svgPoints(projection, context) {
|
||||
return function drawPoints(selection, graph, entities, filter) {
|
||||
var wireframe = context.surface().classed('fill-wireframe'),
|
||||
points = wireframe ? [] : _filter(entities, function(e) {
|
||||
return e.geometry(graph) === 'point';
|
||||
return e.geometry(graph) === 'point' && !e.directions(graph, projection).length;
|
||||
});
|
||||
|
||||
points.sort(sortY);
|
||||
@@ -41,20 +41,24 @@ export function svgPoints(projection, context) {
|
||||
.attr('class', function(d) { return 'node point ' + d.id; })
|
||||
.order();
|
||||
|
||||
enter.append('path')
|
||||
enter
|
||||
.append('path')
|
||||
.call(markerPath, 'shadow');
|
||||
|
||||
enter.append('ellipse')
|
||||
enter
|
||||
.append('ellipse')
|
||||
.attr('cx', 0.5)
|
||||
.attr('cy', 1)
|
||||
.attr('rx', 6.5)
|
||||
.attr('ry', 3)
|
||||
.attr('class', 'stroke');
|
||||
|
||||
enter.append('path')
|
||||
enter
|
||||
.append('path')
|
||||
.call(markerPath, 'stroke');
|
||||
|
||||
enter.append('use')
|
||||
enter
|
||||
.append('use')
|
||||
.attr('transform', 'translate(-5, -19)')
|
||||
.attr('class', 'icon')
|
||||
.attr('width', '11px')
|
||||
|
||||
@@ -72,11 +72,12 @@ export function svgVertices(projection, context) {
|
||||
}
|
||||
|
||||
|
||||
// memoize directions results, return false for empty arrays (for use in filter)
|
||||
function getDirections(entity) {
|
||||
if (entity.id in directions) return directions[entity.id];
|
||||
|
||||
var angles = entity.directions(graph, projection);
|
||||
if (angles) directions[entity.id] = angles;
|
||||
directions[entity.id] = angles.length ? angles : false;
|
||||
return angles;
|
||||
}
|
||||
|
||||
@@ -211,7 +212,7 @@ export function svgVertices(projection, context) {
|
||||
var entity = entities[i],
|
||||
geometry = entity.geometry(graph);
|
||||
|
||||
if (wireframe && geometry === 'point') {
|
||||
if ((geometry === 'point') && (wireframe || entity.directions(graph, projection).length)) {
|
||||
vertices.push(entity);
|
||||
continue;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user