makinacorpus / Leaflet.TextPath

Show text along Polyline with Leaflet
https://makinacorpus.github.io/Leaflet.TextPath/
MIT License
285 stars 112 forks source link

setText function doesn't erase the previous text, just draw the new text above #78

Open ivanmatiaspascual opened 5 years ago

ivanmatiaspascual commented 5 years ago

There is a workaround just setText with null as text.

polyline.setText(null, textOptions); // erase the previous text
polyline.setText(newText, textOptions); // draw the new one
jayli3n commented 1 year ago

Yeah just chain it

polyline.setText(null).setText(newText, textOptions);