mirror of
https://github.com/FoggedLens/iD.git
synced 2026-03-30 00:40:25 +02:00
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.
23 lines
721 B
JavaScript
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; });
|
|
};
|
|
};
|