Opened 5 years ago

Last modified 4 years ago

#18949 closed enhancement

[TaggingPreset] Make templates available for formatting key values, like for item names — at Version 1

Reported by: KorneySan Owned by: team
Priority: normal Milestone: 21.03
Component: Core Version:
Keywords: preset, template_for_key_value, name_template Cc:

Description (last modified by Don-vip)

Proposal is to make formatting by template available for key values like it done for item names.

This is especially usable for public transport routes naming.

In TaggingPresets there is an example for item naming:

<?xml version="1.0" encoding="UTF-8"?>
<presets>
        <item name="Public transportation" type="relation"
                name_template="Bus({operator} {ref} ?{'{from} - {via} - {to}' | '{from} - {to}' | '{from}' | '{to}'})"
                name_template_filter="type=route route=bus">
        </item>
</presets>

which set JOSM to DISPLAY a route relation name by that template. But the same is suitable for the route name by default:

    <text
        key="name"
        text="Name"
        default_template="Bus {ref}?{: '{from} → {to}'}"
        default_template_filter="type=route route=bus">
        />

The value set event should happen for example on route creation dialogue OK button press.

Change History (1)

comment:1 by Don-vip, 5 years ago

Description: modified (diff)
Note: See TracTickets for help on using tickets.