[josm-dev] Mappaint hierachical rules in elemstyles.xml already implemented?

Dirk Stöcker openstreetmap at dstoecker.de
Sat Jan 16 14:34:55 GMT 2010


On Sat, 16 Jan 2010, Ulf Lamping wrote:

> IIRC, someone (Dirk?) said mappaint is already able to handle
> hierachical rules in elemstyles.xml, something like:
>
> <rule>
>   <condition k="amenity" v="parking"/>
>   <icon src="vehicle/parking.png"/>
>
>   <rule>
>     <condition k="parking" v="multi-storey"/>
>     <icon src="vehicle/parking/multi-storey.png"/>
>   </rule>
> </rule>
>
> So if both tags are set, the "more special multi-storey" rule will fit
> before the "more generic parking" rule.
>
> Using the priorities for this is getting a real pain, doesn't work well
> and it's also error prone.
>
>
> Looking at elemstyles.xml I can't find an example.
>
> Am I remembering this wrong?

You above example won't work. What I implemented was boolean AND rules:

  <rule>
    <condition k="amenity" v="parking"/>
    <condition k="parking" v="multi-storey"/>
    <icon src="vehicle/parking/multi-storey.png"/>
  </rule>

Much like conditions in XSL, ugly but it works :-)

Ciao
-- 
http://www.dstoecker.eu/ (PGP key available)





More information about the josm-dev mailing list