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
Using any of your examples styles from Examples.md that include references to properties by name rather than using the "get" expression, or those that use "$type", "!has", etc (full list of old Filters here, scroll to Filters section) with a mixture of the new Expression Syntax.
Expected Behavior
I would expect examples found in Examples.md to work with up to date Mapbox best practices which is to use the Expression syntax rather than the older Filter syntax.
In the very least it would be helpful to user of the library to call out the fact that the older Style Filter syntax is being show/used in the library material and not the updated Expression language.
Actual Behavior
The becomes very confusing when you are trying to make sense of special operators like $type which have little documentation. Error given by the Mapbox and Draw do little to clue you into the fact that the Mapbox style interpreter are failing to use Expression syntax alongside the older Filter syntax.
Errors Given on failure
"layers.polygon-fill-inactive.hot.filter[3][1]: string expected, array found" -- this gets buried quickly do to the next error throwing repeatedly.
"The layer 'polygon-fill-inactive-noncommissioned.cold' does not exist in the map's style and cannot be queried for features."
The text was updated successfully, but these errors were encountered:
I'm also a bit confused by the use of filters in styles. If you wish to style a feature based on a Feature property, should you create 2 styles, and use the filter to distinguish – or an expression in the style itself (see below – which doesn't actually work)
mapbox-gl-js version: v2.0.0
mapbox-gl-draw version: v1.2.0
Steps to Trigger Behavior
Expected Behavior
I would expect examples found in Examples.md to work with up to date Mapbox best practices which is to use the Expression syntax rather than the older Filter syntax.
In the very least it would be helpful to user of the library to call out the fact that the older Style Filter syntax is being show/used in the library material and not the updated Expression language.
Actual Behavior
The becomes very confusing when you are trying to make sense of special operators like $type which have little documentation. Error given by the Mapbox and Draw do little to clue you into the fact that the Mapbox style interpreter are failing to use Expression syntax alongside the older Filter syntax.
Old Filter Syntax
['all',
['==', 'user_prop', 'myVal'],
['==', '$type', 'Point'],
]
Example Bad Filter using mix of Expression/Filter syntax, non obvious issue
['all',
['==', ['get', 'user_prop'], 'myVal'],
['==', '$type', 'Point'],
]
Corrected Expression Syntax
['all',
['==', ['get, , 'user_prop'], 'myVal'],
['==', ['geometry-type'], 'Point'],
]
Errors Given on failure
"layers.polygon-fill-inactive.hot.filter[3][1]: string expected, array found" -- this gets buried quickly do to the next error throwing repeatedly.
"The layer 'polygon-fill-inactive-noncommissioned.cold' does not exist in the map's style and cannot be queried for features."
The text was updated successfully, but these errors were encountered: