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 )
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.