Last active
October 31, 2021 16:06
-
-
Save ericjames/dae441359618fa04e81d7a9ff4d4fdc5 to your computer and use it in GitHub Desktop.
Mapbox Filter Examples
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Toggling the 'feature-state' boolean via map.setFeatureState | |
'line-width': [ | |
'case', | |
['boolean', ['feature-state', 'hover'], false], | |
10, | |
2 | |
] | |
// Interpolation of color and width examples | |
'line-color': [ | |
"interpolate", ["linear"], ['get', "YR_START1"], | |
0, | |
'#edf8e9', | |
1860, | |
'#edf8e9', | |
1870, | |
'#00ff00', | |
1880, | |
'#2244ff', | |
1890, | |
'#ff00ff', | |
1900, | |
'#000' | |
], | |
'line-width': [ | |
"interpolate", ["linear"], ['get', "YR_START1"], | |
0, | |
1, | |
1860, | |
1, | |
1870, | |
2, | |
1880, | |
3, | |
1890, | |
4, | |
1900, | |
6 | |
], |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment