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

Text along polyline looks not good on mobile devices #32

Open
ghost opened this issue Jul 2, 2015 · 9 comments
Open

Text along polyline looks not good on mobile devices #32

ghost opened this issue Jul 2, 2015 · 9 comments

Comments

@ghost
Copy link

ghost commented Jul 2, 2015

We have a couple of mobile apps for mountain biking and hiking trails. Users request the trail name along the polyline, so we tried your plugin.
Due to the screen size on mobile devices the trail name along the path looks quite weird, letters overlap or are spread out or single letters rotate etc.

Is there an option or recommendation to draw the text in a more readable way along a path?

@leplatrem
Copy link
Collaborator

There might be a couple of strategies. One of them could be to add an invisible line that would be a simplified version of the trail geometry, and show the text on this one.

Have you tried the last master with @hanfeisun contribution (#31) ?

@ghost
Copy link
Author

ghost commented Jul 2, 2015

The last master is 2 years old, is this really what you meant?

@leplatrem
Copy link
Collaborator

No sorry I meant #31 :|

@ghost
Copy link
Author

ghost commented Jul 2, 2015

It doesn't improve much, just at high zoom level. So we will look at other strategies.

@leplatrem
Copy link
Collaborator

Thanks, please share your findings!
We would be pleased to review and merge any contribution!

@fredericbonifas
Copy link
Collaborator

By the way I have just deleted the master branch as it was completely out-of-date

@fredericbonifas
Copy link
Collaborator

@bardu It would be great if you could provide a jsfiddle for example with your polylines and text causing problems

@ghost
Copy link
Author

ghost commented Jul 14, 2015

It's not ideal yet as in Google Maps for mobile, but these setting are better for zoom level 13+

polyline.setText(trail.name, {center: true, offset: -10, attributes:{'letter-spacing': '.8em','spacing': 'auto', 'glyph-orientation-vertical': 'inherit', 'glyph-orientation-horizontal': 'inherit'}})

example

BTW, how can I remove the text from the polyline?

@ghost
Copy link
Author

ghost commented Jul 15, 2015

Well, should better read the doc.

polyline.setText(null);

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