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
However, the code it shows filter: ['in', '$type', 'Point'] does not represent a good case for in. It is a simple "match" condition, not an array lookup nor a substring match.
Can we change this example to using ["all", ["match", ["geometry-type"], ["Polygon"], true, false]] or ["all", "$type", ["Polygon"], true, false]] or ["==", "$type", "Polygon"] or something like this?
This would mean we don't have an in example anymore (which I would argue we don't have now, either). I would consider something like https://visgl.github.io/react-map-gl/examples/filter (Code) a better fit. But even better would be a case with a ['literal', ['array']] IMO.
The text was updated successfully, but these errors were encountered:
However, the code it shows filter: ['in', '$type', 'Point'] does not represent a good case for in. It is a simple "match" condition, not an array lookup nor a substring match.
This appears to be an example of the legacy in filter, which is incompatible with expressions. So it’s ironic that it’s being given as an example of how to use the in expression operator.
The https://maplibre.org/maplibre-gl-js/docs/examples/measure/ example is referenced in https://maplibre.org/maplibre-style-spec/expressions/#in as a good way to learn how
in
works.However, the code it shows
filter: ['in', '$type', 'Point']
does not represent a good case forin
. It is a simple "match" condition, not an array lookup nor a substring match.Can we change this example to using
["all", ["match", ["geometry-type"], ["Polygon"], true, false]]
or["all", "$type", ["Polygon"], true, false]]
or ["==", "$type", "Polygon"] or something like this?See also #664
This would mean we don't have an
in
example anymore (which I would argue we don't have now, either). I would consider something like https://visgl.github.io/react-map-gl/examples/filter (Code) a better fit. But even better would be a case with a['literal', ['array']]
IMO.The text was updated successfully, but these errors were encountered: