Modify ↓
#11938 closed enhancement (wontfix)
Small issue with {X.tag} in MapCSS
| Reported by: | naoliv | Owned by: | team |
|---|---|---|---|
| Priority: | normal | Milestone: | |
| Component: | Core validator | Version: | |
| Keywords: | mapcss | Cc: |
Description
With the following test:
*[aeroway = aerodrome] ∈ *[aeroway = aerodrome] { throwWarning: tr("{0} inside {1}", "{1.tag}", "{0.tag}"); }
We can see a message like null inside aeroway=aerodrome when validating.
Is it possible to support the {X.tag} in examples like this?
JOSM
Revision: 8830 Repository Root: http://josm.openstreetmap.de/svn Relative URL: ^/trunk Last Changed Author: simon04 Last Changed Date: 2015-10-05 23:07:07 +0200 (Mon, 05 Oct 2015) Build-Date: 2015-10-06 01:32:08 URL: http://josm.openstreetmap.de/svn/trunk Repository UUID: 0c6e7542-c601-0410-84e7-c038aed88b3b Last Changed Rev: 8830 Identification: JOSM/1.5 (8830 pt_BR) Linux Debian GNU/Linux testing (stretch) Memory Usage: 927 MB / 9102 MB (708 MB allocated, but free) Java version: 1.8.0_66-internal, Oracle Corporation, OpenJDK 64-Bit Server VM VM arguments: [-Dawt.useSystemAAFontSettings=on] Dataset consistency test: No problems found
Attachments (0)
Change History (2)
comment:1 by , 10 years ago
| Resolution: | → wontfix |
|---|---|
| Status: | new → closed |
comment:2 by , 10 years ago
I was trying to avoid "duplicated" rules like this:
*[amenity = university] ∈ *[amenity = university], *[amenity = university] ∈ *[amenity = college], *[amenity = university] ∈ *[amenity = school] { throwWarning: tr("{0} dentro de {1}", "amenity=university", "{0.tag}"); } *[amenity = college] ∈ *[amenity = college] { throwWarning: tr("{0} dentro de {1}", "amenity=college", "{0.tag}"); } *[amenity = school] ∈ *[amenity = school] { throwWarning: tr("{0} dentro de {1}", "amenity=school", "{0.tag}"); } *[aeroway = aerodrome] ∈ *[aeroway = aerodrome] { throwWarning: tr("{0} dentro de {1}", "aeroway=aerodrome", "{0.tag}"); } *[aeroway = helipad] ∈ *[aeroway = helipad] { throwWarning: tr("{0} dentro de {1}", "aeroway=helipad", "{0.tag}"); }
I am unable to get what I want with parent_key(), but I guess it's broken: #11939 (or maybe I just don't know how to use it)
Note:
See TracTickets
for help on using tickets.



{X.tag}is only evaluated for the right hand side of parent/child selectors. CountingXand the code just gets more complicated when taking both sides into account. I would rather not implement that in favour of simplicity. When the lefthand tag is needed, use theparent_tag()function, otherwise just specify the corresponding string.