Line gradient
Create a gradient line using an expression
Use the line-gradient paint property and an expression to visualize distance from the starting point of a line.
This source code of this example is adapted from the MapLibre GL JS example - Create a gradient line using an expression.
Uncomment the following line to install leafmap if needed.
1 | |
1 | |
To run this notebook, you will need an API key from MapTiler. Once you have the API key, you can uncomment the following code block and replace YOUR_API_KEY with your actual API key. Then, run the code block code to set the API key as an environment variable.
1 2 | |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 | |
