esri.layers.FeatureTemplate
| Property | Type | Description |
|---|---|---|
| description | String | The description of the template. |
| drawingTool | String | The default drawing tool defined for the template. See the constants table for a list of valid values. |
| name | String | The templates name. |
| prototype | Graphic |
An instance of the prototypical feature described by the template. It specifies default values for the attribute fields and does not contain geometry. |
| Constant | Description |
|---|---|
| TOOL_ARROW | The default drawing tool specified for this template is the arrow tool. As of version 2.1 |
| TOOL_AUTO_COMPLETE_POLYGON | The default drawing tool specified for this template is a auto complete polygon tool. . |
| TOOL_CIRCLE | The default drawing tool specified for this template is the circle tool. . The Editor dijit will map this to CREATE_TOOL_POLYGON. |
| TOOL_ELLIPSE | The default drawing tool specified for this template is a ellipse tool. The Editor dijit will map this to CREATE_TOOL_POLYGON. |
| TOOL_FREEHAND | The default drawing tool specified for this template is the freehand tool. |
| TOOL_LINE | The default drawing tool specified for this template is the line tool. |
| TOOL_NONE | No default tool is specified. |
| TOOL_POINT | The default drawing tool specified for this template is the point tool. |
| TOOL_POLYGON | The default drawing tool specified for this template is the polygon tool. |
| TOOL_RECTANGLE | The default drawing tool specified for this template is the rectangle. As of version 2.1 |
| TOOL_RECTANGLE | The default drawing tool specified for this template is the rectangle tool. |
| TOOL_TRIANGLE | The default drawing tool specified for this template is the triangle As of version 2.1 |
| Method | Return Value | Description |
|---|---|---|
| toJson() | Object | Converts object to its ArcGIS Server JSON representation. |
An instance of the prototypical feature described by the template. It specifies default values for the attribute fields and does not contain geometry.
Create a feature based on a prototype.
var park = featureLayer.templates[0].prototype; var newPark = new esri.Graphic(park.toJson()); newPark.setGeometry(polygon); featureLayer.applyEdits([ newPark ]);