From 16ca10708b2c3f6d61c0ec1b05f57533be7ba925 Mon Sep 17 00:00:00 2001 From: Bryan Housel Date: Thu, 26 Nov 2015 01:11:46 -0500 Subject: [PATCH] Fix oneway markers in IE --- css/map.css | 7 +------ js/id/id.js | 2 ++ js/id/svg/defs.js | 7 ++++++- js/id/svg/lines.js | 4 ++++ 4 files changed, 13 insertions(+), 7 deletions(-) diff --git a/css/map.css b/css/map.css index 4a371b7a9..4f27b635a 100644 --- a/css/map.css +++ b/css/map.css @@ -24,7 +24,7 @@ img.tile-removing { use { pointer-events: none; } /* base styles */ -.layer path { fill: none; } +.layer path:not(.oneway) { fill: none; } .layer use path { fill: #333; } /* FF svg icons */ g.point .shadow, @@ -1290,11 +1290,6 @@ text { fill: #002F35; } -marker#oneway-marker path { - fill:#000; - opacity: .5; -} - path.oneway { stroke-width: 6px; } diff --git a/js/id/id.js b/js/id/id.js index bcc7f96e2..b04565e5a 100644 --- a/js/id/id.js +++ b/js/id/id.js @@ -371,9 +371,11 @@ iD.version = '1.8.0'; detected.version = detected.version.split(/\W/).slice(0,2).join('.'); if (detected.browser.toLowerCase() === 'msie') { + detected.ie = true; detected.browser = 'Internet Explorer'; detected.support = parseFloat(detected.version) > 9; } else { + detected.ie = false detected.support = true; } diff --git a/js/id/svg/defs.js b/js/id/svg/defs.js index a9a5660f3..03054e377 100644 --- a/js/id/svg/defs.js +++ b/js/id/svg/defs.js @@ -27,10 +27,15 @@ iD.svg.Defs = function(context) { refX: 5, markerWidth: 2, markerHeight: 2, + markerUnits: 'strokeWidth', orient: 'auto' }) .append('path') - .attr('d', 'M 5 3 L 0 3 L 0 2 L 5 2 L 5 0 L 10 2.5 L 5 5 z'); + .attr('class', 'oneway') + .attr('d', 'M 5 3 L 0 3 L 0 2 L 5 2 L 5 0 L 10 2.5 L 5 5 z') + .attr('stroke', 'none') + .attr('fill', '#000') + .attr('opacity', '0.5'); // patterns var patterns = defs.selectAll('pattern') diff --git a/js/id/svg/lines.js b/js/id/svg/lines.js index 30a6aaf7b..474057fd1 100644 --- a/js/id/svg/lines.js +++ b/js/id/svg/lines.js @@ -117,6 +117,10 @@ iD.svg.Lines = function(projection) { oneways .attr('d', function(d) { return d.d; }); + if (iD.detect().ie) { + oneways.each(function() { this.parentNode.insertBefore(this, this); }); + } + oneways.exit() .remove();