dojo.require("esri.layers.FeatureTemplate")
Description
(Added at v2.0)
Feature templates define the information required to create a new feature.
Samples
Search for
samples that use this class.
Constants
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_TRIANGLE | The default drawing tool specified for this template is the triangle. As of version 2.1 |
Properties
Methods
toJson() | Object | Converts object to its ArcGIS Server JSON representation. |
Property Details
The description of the template.
The default drawing tool defined for the template. See the constants table for a list of valid values.
An instance of the prototypical feature described by the template. It specifies default values for the attribute fields and does not contain geometry.
Sample: 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 ]);
An object used to create a thumbnail image that represents a feature type in the FeatureTemplate. Use this property to override the default thumbnails depicting simple symbols when editing features from a map service represented with complex symbology. (Added at v3.18)
Object Specifications: <thumbnail
>
<string > contentType |
Required |
The MIME type of the image. This value may be image , png , jpg or jpeg . |
<number > height |
Required |
The height of the thumbnail in points. |
<string > imageData |
Required |
The base64EncodedImageData representing the thumbnail image. |
<number > width |
Required |
The width of the thumbnail in points. |
Method Details
Converts object to its ArcGIS Server JSON representation. (Added at v2.1)