Skip to content
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

Change example "measure" from using in to something else #665

Open
tordans opened this issue May 15, 2024 · 0 comments
Open

Change example "measure" from using in to something else #665

tordans opened this issue May 15, 2024 · 0 comments
Labels
bug Something isn't working

Comments

@tordans
Copy link

tordans commented May 15, 2024

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 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?

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.

@tordans tordans added the bug Something isn't working label May 15, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant