mapbox / carto

fast CSS-like map stylesheets
https://cartocss.readthedocs.io/
Apache License 2.0
654 stars 129 forks source link

Provide shorthand for list of = filters without using regular expressions #464

Open nebulon42 opened 7 years ago

nebulon42 commented 7 years ago

Instead of having to write e.g.

[type='motorway_link'],
[type='trunk_link'],
[type='primary_link'],
[type='secondary_link'],
[type='tertiary'],
[type='tertiary_link'],
[type='unclassified'],
[type='residential'],
[type='living_street'] {
...
}

allow writing e.g.

[type in 'motorway_link', 'trunk_link', 'primary_link', 'secondary_link',
'tertiary', 'tertiary_link', 'unclassified', 'residential', 'living_street'] {
...
}

Avoid regular expressions because of possible explosion of rules due to #213.

pnorman commented 7 years ago

The main use I see is when combining with another rule to reduce duplication of writing that other rule.

Most of the code I've written that looks like this add another rule add zoom, and zoom isn't constant across the different types of feature so an in construct wouldn't help there.