LineLayer with gradient color from beginning to end #666
Answered
by
Danwolve98
Danwolve98
asked this question in
Q&A
-
Beta Was this translation helpful? Give feedback.
Answered by
Danwolve98
Nov 6, 2025
Replies: 2 comments 2 replies
-
|
You'd want to set the line
What did your A sample JSON expression would be like: ["interpolate",
["linear"],
["line-progress"],
0, "blue",
1, "red"
]Which is represented in MapLibre Compose as: interpolate(
type = linear(),
input = lineProgress(),
0 to const(Color.Blue),
1 to const(Color.Red),
), |
Beta Was this translation helpful? Give feedback.
0 replies
-
Beta Was this translation helpful? Give feedback.
2 replies
Answer selected by
Danwolve98
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment


I don't know why, but my
lineProgress()function wouldn't let me create it as an empty constructor, and when I passed it a value, it just stayed the same.But I've found a way to do it; I've attached the code snippet. Thanks.