-
Notifications
You must be signed in to change notification settings - Fork 2.2k
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
Getting error on interpolation function #5737
Comments
Hi @yoursweater. I'm not able to reproduce that error running that code. Could you provide a self-contained JSFiddle that demonstrates the issue? |
This is embarrassing, but for some reason I'm having difficulty getting that set up as well. I can add a layer or load in a map without any difficulty locally, but my jsfiddle is refusing to work. Even using someone else's map, just doing this causes the map to fail to load:
|
Thanks @yoursweater. I was able to reproduce this issue locally using the expression you provided in the original post. It looks like the issue is that, for one of the features, Meanwhile, a temporary workaround would be to replace |
Actually looks like we have an issue for this for functions already -- let's use that to track. Duplicate of #4172 |
I'm trying to change the fill-color of my layer based on two properties, and I'm getting an odd error:
Error: layers.fullcitylayer.paint.fill-color: color expected, array found
The Documentation is very clear that interpolation expressions can validly be used in place of a color.
Here's the code I'm attempting to enter in:
map.setPaintProperty('fullcitylayer', 'fill-color', ['interpolate',['linear'],['/', ['get', 'B19001_017'], ['/', ['get', 'ALAND'], 1000000]],10,'#00adef',100,'#212529',1000,'#ea950b',5000,'#e94e34'] )
Is this just a bug?
The text was updated successfully, but these errors were encountered: