Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Option to choose repeat spacing #95

Closed
nekromoff opened this issue Oct 1, 2023 · 3 comments
Closed

Option to choose repeat spacing #95

nekromoff opened this issue Oct 1, 2023 · 3 comments

Comments

@nekromoff
Copy link

nekromoff commented Oct 1, 2023

repeat: true now does continuous text repeat.

I wanted to have a repeat with some spacing between text elements.

My workaround was to add a condition to pad the text with a non-breakable space after line 81:

if (options.repeat!=true && options.repeat>=1) {
    text=text.padStart(options.repeat, '\u00A0');
}

Now I can do space separated repeat such as:
repeat: 10 and get this (example):
image

This improves map clutter cause by continuous repeat, e.g. it looked like this before:
image

@babastienne
Copy link
Member

Hello @nekromoff

Thanks for reporting this issue. 🙏

In fact, even in the demo on this repository we're using a trick (some space characters) to add some spacing between repeated text, as you can see here : https://github.com/makinacorpus/Leaflet.TextPath/blob/master/docs/example.html#L57

The solution used in the demo is definitely not the prettiest one and is more of a workaround.

I like your suggestion, considering it's not breaking the current behavior and just adding some option to format the repeated text. Could you make a PR to add the feature you're using to the next version of this library ?

@nekromoff
Copy link
Author

nekromoff commented Oct 1, 2023 via email

nekromoff added a commit to nekromoff/Leaflet.TextPath that referenced this issue Oct 8, 2023
@nekromoff
Copy link
Author

#96

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants