-
-
Notifications
You must be signed in to change notification settings - Fork 6k
Closed
Description
I wanted my lines to be dashed in a Leaflet map I've been working on. This was very easy to implement if the client supports SVG. I added this code at line 86 of Path.SVG.js:
if (this.options.dasharray) {
this._path.setAttribute('stroke-dasharray', this.options.dasharray);
}
This lets you set the "stroke-dasharray" attribute by changing a simple option to the Path object:
e.layer.setStyle({
dasharray: "8,6"
});
The product is a pretty nice looking dashed line:
This obviously only works with SVG, but I wonder how much work it would be to implement in Canvas. There are some folks who have had some luck doing this.
Any thoughts, opinions?
