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

Implement data-driven styling for line-gradient #5037

Open
herbetom opened this issue Nov 12, 2024 · 5 comments
Open

Implement data-driven styling for line-gradient #5037

herbetom opened this issue Nov 12, 2024 · 5 comments
Labels
need more info Further information is requested

Comments

@herbetom
Copy link

herbetom commented Nov 12, 2024

User Story

I would like to style lines based on data.

Rationale

It's currently (as far as i can tell) not possible to define gradients based on values provided via geojson properties. This means all gradients of a layer are the same.

For example i've got a "Transmit Quality" value for two points (and many of them). I would like to draw a line between them and color it with a gradient according to the two values (for example red if the value is low, yellow if it's in the middle and green if it's high).

image

What i can do today is create a seperate layer for each possible gradient combination. But in my case that would mean creating hundreds of layers. Instead it would be nice to do some form of property lookup for the desired values and change the gradient within the layer.

@HarelM
Copy link
Collaborator

HarelM commented Nov 12, 2024

I believe this is possible now already with "line-progress", isn't it?

@HarelM HarelM added the need more info Further information is requested label Nov 12, 2024
@herbetom
Copy link
Author

From my understanding line-progress is an quite essential part of displaying gradients (which are supported) but then the gradient in itself is hardcoded and identical for the whole layer.

https://maplibre.org/maplibre-style-spec/layers/#line-gradient
maplibre/maplibre-style-spec#740

@HarelM
Copy link
Collaborator

HarelM commented Nov 13, 2024

Reading the user story again, I'm not sure I understand the ask... Can you please clarify it in the original post?

@herbetom
Copy link
Author

done. Let me know if it's still unclear.

@HarelM
Copy link
Collaborator

HarelM commented Nov 17, 2024

Sorry, still not fully clear... Can you add a geojson example to showcase the input, with the current solution off multiple layers and the "wishfull" solution?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
need more info Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants