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

How to combine case expression and property in styling line-color? #10760

Closed
kldziwon opened this issue Jun 10, 2021 · 1 comment
Closed

How to combine case expression and property in styling line-color? #10760

kldziwon opened this issue Jun 10, 2021 · 1 comment

Comments

@kldziwon
Copy link

kldziwon commented Jun 10, 2021

Hi,
I'm stuck with styling line-color. I want to achieve something like this below, but I don't know how to get color combining colorId and stops in case expression

    'line-color': ['case',
      ['==', ['get', 'isOpen'], true], *use color based on property colorId and stops*, '#878787',
    ],

I've tried, but it didn't worked

    'line-color': ['case',
  ['==', ['get', 'isOpen'], true], {stops, property: 'colorId'}, '#878787',
],
@karimnaaji
Copy link
Contributor

I believe what you looking for might be line gradients. Which generally achieve these stop-based rendering of colors on lines. But unfortunately, you're trying to get the color stops inferred from the data, and we currently do not support data driven line gradients.

I'll close as duplicate of #8977, but feel free to reopen if I misunderstood your use case.

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