template

Templates describe features that can be created in a layer. They are generally used with feature collections and editable web-based CSV layers. Templates are not used with ArcGIS feature services as these already have templates defined in the service. They are also defined as properties of the layer definition when there are no defined types. Otherwise, templates are defined as properties of the types.

Referenced by: layerDefinition, type

Properties

Property Details
description A string value containing a detailed description of the template.
drawingTool An optional string that can define a client-side drawing tool to be used with this feature. For example, map notes used by the Online Map Viewer use this to represent the viewer's different drawing tools.
Valid values: esriFeatureEditToolAutoCompletePolygon, esriFeatureEditToolCircle, esriFeatureEditToolDownArrow, esriFeatureEditToolEllipse, esriFeatureEditToolFreehand, esriFeatureEditToolLeftArrow, esriFeatureEditToolLine, esriFeatureEditToolNone, esriFeatureEditToolPoint, esriFeatureEditToolPolygon, esriFeatureEditToolRectangle, esriFeatureEditToolRightArrow, esriFeatureEditToolText, esriFeatureEditToolTriangle, esriFeatureEditToolUpArrow
name A string containing a user-friendly name for the template.
prototype A feature object representing a prototypical feature for the template.
See prototype properties table.

prototype properties

Property Details
attributes The feature attributes. A JSON object that contains a dictionary of name-value pairs. The names are the feature field names. The values are the field values, and they can be any of the standard JSON types: string, number, and boolean. Note that date values are encoded as numbers. The number represents the number of milliseconds since epoch (January 1, 1970) in UTC.

Additional information

drawingTool strings: esriFeatureEditToolPolygon, esriFeatureEditToolTriangle, esriFeatureEditToolRectangle, esriFeatureEditToolLeftArrow, esriFeatureEditToolRightArrow, esriFeatureEditToolEllipse, esriFeatureEditToolUpArrow, esriFeatureEditToolDownArrow, esriFeatureEditToolCircle, esriFeatureEditToolFreehand, esriFeatureEditToolLine, esriFeatureEditToolText, esriFeatureEditToolPoint

template Example

{
  "drawingTool": "esriFeatureEditToolFreehand",
  "description": "Groomed cross-country skiing trails",
  "name": "X-country skiing",
  "prototype": {
    "attributes": {
      "VISIBLE": 1,
      "TITLE": "Cross-country skiing",
      "TYPEID": 5
    }
  }
}

Your browser is no longer supported. Please upgrade your browser for the best experience. See our browser deprecation post for more details.