Files
iD/js/id/svg/surface.js
Tom MacWright 27c0edb2c1 Resample oneway paths to produce markers.
This uses a technique created by @mbostock in http://bl.ocks.org/mbostock/4965670
Need to confirm that this is faster. It is definitely cleaner.
2013-03-06 21:08:50 -05:00

23 lines
721 B
JavaScript

iD.svg.Surface = function() {
return function drawSurface(selection) {
var defs = selection.append('defs');
defs.append('marker')
.attr({
id: 'oneway-marker',
viewBox: '0 0 10 10',
refY: 2.5,
markerWidth: 2,
markerHeight: 2,
orient: 'auto'
})
.append('path')
.attr('d', 'M 0 0 L 5 2.5 L 0 5 z');
var layers = selection.selectAll('.layer')
.data(['fill', 'shadow', 'casing', 'stroke', 'text', 'hit', 'halo', 'label']);
layers.enter().append('g')
.attr('class', function(d) { return 'layer layer-' + d; });
};
};