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

Can we make the property fontSize take function values? #300

Closed
nickidlugash opened this issue Feb 19, 2014 · 4 comments
Closed

Can we make the property fontSize take function values? #300

nickidlugash opened this issue Feb 19, 2014 · 4 comments

Comments

@nickidlugash
Copy link

Would it make any sense to do this? Is there a method which would make more sense that would enable different font sizes across different zoom levels?

@edenh
Copy link
Contributor

edenh commented Feb 19, 2014

+1 here. Any chance we can move fontSize and padding out of the bucket declaration and into the style declaration?

cc @ansis

@ansis
Copy link
Contributor

ansis commented Feb 19, 2014

You can set a size property in text styles that can be a function, for example: https://github.com/mapbox/llmr/blob/51abc44e593a3ddc2f8dd918330f5ab7bc3bcee3/debug/style.js#L439

This only works properly for horizontal labels. I'm working on getting it to work around curves as well, but this is a bit tricky. Also, you still need a fontSize in the bucket for collision prevention. The size in the style should never be bigger than the fontSize in the bucket.

and maybe we should rename size to fontSize or vice versa.

@nickidlugash
Copy link
Author

@ansis thanks for the explanation! I'll play around with size for some horizontal labels. Would be very useful to be able to use functions for curved labels since road labels are one of the most critical features needing variable font sizing.

@ansis
Copy link
Contributor

ansis commented Feb 20, 2014

Starting cac61d0, font sizes as functions should work for all labels.

@ansis ansis closed this as completed Feb 20, 2014
lucaswoj pushed a commit that referenced this issue Jan 11, 2017
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

3 participants