UNPKG

@mapeo/schema

Version:

JSON schema and flow types for Mapeo

183 lines (97 loc) 3.35 kB
[API](../README.md) / Preset # Interface: Preset Presets define how map entities are displayed to the user. They define the icon used on the map, and the fields / questions shown to the user when they create or edit the entity on the map. The `tags` property of a preset is used to match the preset with observations, nodes, ways and relations. If multiple presets match, the one that matches the most tags is used. ## Table of contents ### Properties - [addTags](Preset.md#addtags) - [additionalFields](Preset.md#additionalfields) - [fields](Preset.md#fields) - [geometry](Preset.md#geometry) - [icon](Preset.md#icon) - [id](Preset.md#id) - [name](Preset.md#name) - [removeTags](Preset.md#removetags) - [schemaVersion](Preset.md#schemaversion) - [sort](Preset.md#sort) - [tags](Preset.md#tags) - [terms](Preset.md#terms) ## Properties ### addTags`Optional` **addTags**: `Object` Tags that are added when changing to the preset (default is the same value as 'tags') #### Index signature ▪ [k: `string`]: `unknown` #### Defined in preset/v1.ts:42 ___ ### additionalFields`Optional` **additionalFields**: `string`[] Additional fields to display (used internally by Mapeo Desktop, no need to define this in preset) #### Defined in preset/v1.ts:58 ___ ### fields`Optional` **fields**: `string`[] IDs of fields to displayed to the user when the preset is created or edited #### Defined in preset/v1.ts:54 ___ ### geometry • **geometry**: [``"point"`` \| ``"vertex"`` \| ``"line"`` \| ``"area"`` \| ``"relation"``, ...("point" \| "vertex" \| "line" \| "area" \| "relation")[]] Valid geometry types for the feature - this preset will only match features of this geometry type `"point", "vertex", "line", "area", "relation"` **`Min Items`** 1 #### Defined in preset/v1.ts:29 ___ ### icon`Optional` **icon**: `string` ID of preset icon which represents this preset #### Defined in preset/v1.ts:62 ___ ### id • **id**: `string` Unique value that identifies this element #### Defined in preset/v1.ts:19 ___ ### name • **name**: `string` Name for the feature in default language. #### Defined in preset/v1.ts:23 ___ ### removeTags`Optional` **removeTags**: `Object` Tags that are removed when changing to another preset (default is the same value as 'addTags' which in turn defaults to 'tags') #### Index signature ▪ [k: `string`]: `unknown` #### Defined in preset/v1.ts:48 ___ ### schemaVersion`Optional` **schemaVersion**: ``1`` Version of schema. Should increment for breaking changes to the schema #### Defined in preset/v1.ts:15 ___ ### sort`Optional` **sort**: `number` When presets are displayed as a list, defines the order it should be sorted. Presets with lowest sort numbers are displayed first #### Defined in preset/v1.ts:70 ___ ### tags • **tags**: `Object` The tags are used to match the preset to existing map entities. You can match based on multiple tags E.g. if you have existing points with the tags `nature:tree` and `species:oak` then you can add both these tags here in order to match only oak trees. #### Index signature ▪ [k: `string`]: `unknown` #### Defined in preset/v1.ts:36 ___ ### terms`Optional` **terms**: `string`[] Synonyms or related terms (used for search) #### Defined in preset/v1.ts:66