Merkaartor/Tag Templates

From OpenStreetMap Wiki
Jump to navigation Jump to search

Merkaartor's tag templates provide easy-to-use and more controlled means of adding tags to map features. They are what define the tag entry fields that appear in the Properties window (below the Node ID, Latitude and Longitude fields).

Templates can be saved, merged, and loaded, via the Tools > Tag templates menu.

.mat Template Files

Template files are XML files with the following general structure:

<templates><!-- Root element -->

    <widgets><!-- Widgets for all templates live within here. -->

        <!-- Each widget defines an OSM tag and how it shall be edited. -->
        <widget tag="widget-name" type="combo"><!-- Type must be one of: 'edit', 'combo', 'yesno', or 'constant'. -->
            <description locale="en">Widget name</description>
            <link src="http://wiki.openstreetmap.org/index.php/Key:widget-name"/>
            <selector expr="Type is Area or Type is TrackPoint"/><!-- Could someone explain selector expressions please? -->
            <value tag="value"><!-- A desired value for Key:widget-name -->
                <description locale="en">Value label</description>
            </value>
        </widget>

    </widgets>

    <template><!-- Each template must start with a description... -->
        <description locale="en">Template name</description>
        <!-- ...and have one or more widgetref elements. -->
        <widgetref id="widget-name" /><!-- ID refers to a widget defined above. -->
    </template>

</templates>

Some notes:

  • The description tag's locale attribute is always required.
  • The XML Schema is available.