New stroke-linecap style option with a VML alternative. For #1643.
This commit is contained in:
parent
26093848ed
commit
665a956bc2
@ -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');
|
||||
}
|
||||
|
@ -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);
|
||||
|
@ -18,6 +18,7 @@ L.Path = L.Class.extend({
|
||||
stroke: true,
|
||||
color: '#0033ff',
|
||||
dashArray: null,
|
||||
linecap: null,
|
||||
weight: 5,
|
||||
opacity: 0.5,
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user