You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
What I'd like to achieve is putting a textpath at the end of the polyline. Would it be possible to add an option for that?
Adding this code for 'option.end' works for my particular use-case, but text placement is dependent on angle of the path still:
/* put text at end of the path */
if (options.end) {
var textWidth = textNode.getBBox().width;
var pathWidth = this._path.getBBox().width;
/* Set the position for the left side of the textNode */
textNode.setAttribute('dx', pathWidth - textWidth );
}
Together with '\u25BA' something like this would allow for arrowheads on polylines.
hth,
Emile
The text was updated successfully, but these errors were encountered:
Hi Emile,
For this particular use-case, I suggest you use @fredericbonifas's plugin Leaflet.LineExtremities ! It does just that, and will manage orientation automatically (SVG built-in feature) !
Otherwise, it could make sense to add this option, but unfortunately I can't spend time on this :|
New case where I'd want to use an 'end' option, together with an offset (LineExtremities can't do that).
Would it be ok if I created a pull request for adding the 'end' option (code+doc)?
Hi,
What I'd like to achieve is putting a textpath at the end of the polyline. Would it be possible to add an option for that?
Adding this code for 'option.end' works for my particular use-case, but text placement is dependent on angle of the path still:
Together with '\u25BA' something like this would allow for arrowheads on polylines.
hth,
Emile
The text was updated successfully, but these errors were encountered: