I’m trying my hand at customizing the styles of the output of an Overpass Turbo query by following the MapCSS specification.
I’m trying to show all restaurants that are nodes or ways within the bounding box. Furthermore, I want restaurants that have never been checked or haven’t been checked in 2024 or 2025 to be red.
My query is as follows (link to the same query in Overpass Turbo):
[timeout:25];
nw[amenity=restaurant]({{bbox}});
out geom;
{{style:
way[check_date!~/^2024.*$/],
node[check_date!~/^2024.*$/],
way[check_date!~/^2025.*$/],
node[check_date!~/^2024.*$/],
way[!check_date],
node[!check_date]
{ color:red; width:1; }
}}
Expected result: Shows me all restaurants with those that haven’t been checked since prior to 2024 or never checked at all painted red.
Actual result: “Invalid MapCSS stylesheet: MapCSS runtime error.”
Additional info:
The following query applies my desired styles to restaurants that have never been checked (Overpass Turbo):
[timeout:25];
nw[amenity=restaurant]({{bbox}});
out geom;
{{style:
way[!check_date],
node[!check_date]
{ color:red; width:1; }
}}
And the following query applies my desired styles to restaurants that have been checked in 2024 or 2025 (Overpass Turbo):
[timeout:25];
nw[amenity=restaurant]({{bbox}});
out geom;
{{style:
way[check_date=~/^2024.*$/],
node[check_date=~/^2024.*$/],
way[check_date=~/^2025.*$/],
node[check_date=~/^2024.*$/]
{ color:red; width:1; }
}}
But how do I negate these conditions (which is what I really want)?
Following the examples on JOSM/MapCSS Validator Syntax, I think this should work (reference the last example in the table under the section “Value evaluation within blocks”); however, these examples are from the MapCSS page on the JOSM wiki. I’ve found two MapCSS pages on the OSM wiki that do not mention the specific use case I’m describing above: Overpass turbo/MapCSS and Overpass API/Overpass API by Example.
Am I doomed? Thanks in advance!