type

Types contain information about the combinations of attributes allowed for features in the dataset. Each feature in the dataset can have a type, indicated in its typeIdField, which is used in layerDefinition.

Properties

Property

Details

domains

A comma-delimited series of domain objects for each domain in the type. The domain objects are defined using the syntax of the ArcGIS REST API. The domains are listed in the following format:

"domains" : {
      "<domainField1>" : <domain1>,
      "<domainField2>" : <domain2>
    }

id

A unique numerical ID for the type.

name

A string containing a user-friendly name for the type. This can be shown on a menu of feature types that editors can create in the collection.

templates

An array of template objects describing features that can be created in this layer. Templates are used with map notes, other feature collections, and editable web-based CSV layers. They are not used with ArcGIS feature services, which already have feature templates defined in the service.

Templates are defined as a property of the layer definition when there are no types defined; otherwise, templates are defined as properties of the types.

You can have more than one template per type if the attributes of available features vary slightly. For example, you might have a type named Copper pipe containing two templates: one whose DIAMETER property is 12 and another whose DIAMETER property is 10.

Example

"types": [
              {
                "id": 0,
                "templates": [{
                  "drawingTool": "esriFeatureEditToolFreehand",
                  "description": "",
                  "name": "Walking",
                  "prototype": {"attributes": {
                    "VISIBLE": 1,
                    "TITLE": "Walking",
                    "TYPEID": 0
                  }}
                }],
                "domains": {},
                "name": "Walking"
              },
              {
                "id": 1,
                "templates": [{
                  "drawingTool": "esriFeatureEditToolFreehand",
                  "description": "",
                  "name": "Biking",
                  "prototype": {"attributes": {
                    "VISIBLE": 1,
                    "TITLE": "Biking",
                    "TYPEID": 1
                  }}
                }],
                "domains": {},
                "name": "Biking"
              }   
            ]
7/5/2017