New stroke-linecap style option with a VML alternative. For #1643.

This commit is contained in:
palewire 2013-07-12 22:37:30 -07:00
parent 26093848ed
commit 665a956bc2
3 changed files with 7 additions and 0 deletions

View File

@ -80,6 +80,9 @@ L.Path = L.Path.extend({
} else {
this._path.removeAttribute('stroke-dasharray');
}
if (this.options.linecap) {
this._path.setAttribute('stroke-linecap', this.options.linecap);
}
} else {
this._path.setAttribute('stroke', 'none');
}

View File

@ -82,6 +82,9 @@ L.Path = L.Browser.svg || !L.Browser.vml ? L.Path : L.Path.extend({
} else {
stroke.dashStyle = '';
}
if (options.linecap) {
stroke.endcap = options.linecap.replace('butt', 'flat');
}
} else if (stroke) {
container.removeChild(stroke);

View File

@ -18,6 +18,7 @@ L.Path = L.Class.extend({
stroke: true,
color: '#0033ff',
dashArray: null,
linecap: null,
weight: 5,
opacity: 0.5,