Leaflet.PolylineDecorator
Leaflet.PolylineDecorator copied to clipboard
Add a Symbol.Text option
I have used the PolylineDecorator with please for a while now, but has a need to try adding a text symbol (an icon) along the line. I have looked at the TextPath library that does not work with the new leaflet anymore. Has anyone gotten this to work, or has the ninja-skills to add it to the L.Symbol class?
Thanks for any assistance or hints!
Downloading the icon as svg and placing it like the aeroplane in the example worked like a charm. Flexible icons is a little more tricky, but doable. Still interested though, in placing text along the line.
Hi! Glad it worked with an SVG icon. Maybe I should write it more explicitely that it works out ot the box.
On the other hand, placing any text string along the line is a different matter that doesn't match the plugin inner workings.
I was glad to advise people to use Leaflet.TextPath for that, but I hadn't noticed it had gone so unmaintained. Actually their leaflet0.8-dev
branch seems to work with the latest Leaflet version, but this is old and hard to find. I'll try to find time to propose a patch to update the project.
njbuch, please find some instruction to use textpath with leaflet 1.* here: https://github.com/makinacorpus/Leaflet.TextPath/issues/56