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

Control properties by zoom level? #311

Closed
nickidlugash opened this issue Feb 25, 2014 · 5 comments
Closed

Control properties by zoom level? #311

nickidlugash opened this issue Feb 25, 2014 · 5 comments

Comments

@nickidlugash
Copy link

Is there a way to control properties by zoom level, other than assigning functions to numerical values? E.g. if you wanted to completely change the color of a feature at a certain zoom level? Not a big deal right now, since a lot of the properties this would be most useful for are not supported (like multiple font stacks or text transform), but I think this would eventually be important.

@kkaefer
Copy link
Member

kkaefer commented Feb 26, 2014

This is easy from a rendering perspective, but the tricky part is to find a syntax that doesn't unnecessarily complicate the stylesheet. Right now, you could do this as a stops functions, with two stops at the zoom level, the first specifying the previous value and the second with the new value.

@nickidlugash
Copy link
Author

@kkaefer Thanks! What is the syntax for writing stop functions? Will try it out and then describe more specifically here the use cases where we will need another method.

@nickidlugash
Copy link
Author

@kkaefer what arguments does the stop function take? Do you have an example you could share?

@kkaefer
Copy link
Member

kkaefer commented Mar 20, 2014

The syntax is: ["stops", {z: 0, val: 4}, {z:3, val: 8}, ...]. It exponentially interpolates between two stop values.

@mourner
Copy link
Member

mourner commented Jun 24, 2014

Stops work for colors now, so I think the issue can be closed.

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