Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • #56363
    Avatar photoEmux
    Participant

    I implemented the exclusive / except negation rule in Mapsforge themes.
    See the render theme documentation.

    A minus sign “-” excludes the other values after “|”. It never works alone.

    <!– match tunnel-tag that are not 'no' or 'false' –>
    <rule k="tunnel" v="-|no|false">
    

    It will be available in the next Mapsforge version.


    Cruiser and Mapsforge developer

    • This topic was modified 1 month, 1 week ago by Avatar photoEmux.
    3 users thanked author for this post.
    #56365
    tartiflette74
    Participant

    Great! What will be the the first version number of Mapsforge with this feature? How to check which Mapsforge version is used by a given version of Locus? (any chance it will come to Locus classic?) Thanks!

    #56366
    Avatar photoEmux
    Participant

    Next Mapsforge 0.22.0 will include it.

    Cruiser 5 (Beta) already uses it with the new Motorider theme that is also included in Mapsforge.


    Cruiser and Mapsforge developer

    #56387
    tartiflette74
    Participant

    From the source code comments, it seems that

    <rule k="tunnel" v="-|no|false">

    matches tunnel tags that are either missing, or neither ‘no’ nor ‘false’; to only match tags that are present, two embedded rules are required:

    <rule k="tunnel"><rule k="tunnel" v="-|no|false">

    . Is this correct?
    Thanks

    #56389
    Avatar photoEmux
    Participant

    @tartiflette74

    Maybe the source code comment is not written correctly.
    See also how it is described in the render theme documentation.

    More important are real tests. Have you tried and seen anything strange?
    Any particular example that needs improvement?


    Cruiser and Mapsforge developer

    #56390
    Avatar photoEmux
    Participant

    Looking at the VTM themes where we already use this rule, indeed for the described behavior we use 2 nested rules.
    An example is here.

    Copying here the source code comment:
    “‘except negation’ matches when KEY is present, none items of VALUE is present.
    (can be emulated by <rule k=”a”><rule k=a v=”-|b|c”>…</rule></rule>)”


    Cruiser and Mapsforge developer

Viewing 6 posts - 1 through 6 (of 6 total)
  • You must be logged in to reply to this topic.