You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@NicolasMinghetti thanks for reporting this issue, and for including a test case!
It's true that Map#setFilter() accepts null as a way to remove a layer's filter. However, Map#setStyle() (and, similarly, Map#addLayer()) expect layers that conform to the Mapbox GL Style Specification, which doesn't currently allow for filter to be null.
If you want to remove a layer's filter via setStyle, you can do so by omitting the filter: property from the layer (rather than setting it to null or undefined)
anandthakker
changed the title
map.setSyle() throws an error when layer has filter= null
map.getStyle() after map.setFilter(id, null) returns invalid Style JSON
Nov 9, 2017
mapbox-gl-js version 0.41.0:
Steps to Trigger Behavior
https://jsbin.com/simifaf/2/edit?html,js,console,output
Expected Behavior
Set a filter to null with map.setFilter() is allowed by mapboxGL #4777
map.setStyle() should allow layers to have filter: null
Actual Behavior
map.setStyle() throws an error if a layer has its filter to null
The text was updated successfully, but these errors were encountered: