Class FeatureTemplate

java.lang.Object
com.esri.arcgisruntime.data.FeatureTemplate

public final class FeatureTemplate extends Object
A feature template defines the default attribute values for the fields of a newly created ArcGISFeature and suggests a type of drawing tool to sketch the feature's geometry.

The owner of the ArcGIS feature service can define one or more feature templates when they publish the service. These are held within the "Templates" tag of the ArcGIS feature service's REST Services Directory. Each template has a name, description, suggested drawing tool, and a list of attributes with their initial values (called prototype). You can obtain the feature service's collection of feature templates from the ArcGISFeatureTable.getFeatureTemplates(). Alternatively, if you are using a FeatureType, you can obtain its templates from FeatureType.getTemplates(). Use ArcGISFeatureTable.createFeature(FeatureTemplate) to create a feature with the feature template.

If you are building an editing application, you can present users with a list of feature templates. Upon choosing a template, the app can create a feature with the attributes populated with their default values and present geometry sketching tools to match the getDrawingTool().

Since:
100.0.0
  • Method Details

    • getDescription

      public String getDescription()
      Gets the feature template description.
      Returns:
      the description
      Since:
      100.0.0
    • getDrawingTool

      public FeatureTemplate.DrawingTool getDrawingTool()
      Gets the type of drawing tool that could be used to draw this feature in an editing application.
      Returns:
      drawing tool that could be used to draw this feature
      Since:
      100.0.0
    • getName

      public String getName()
      Gets the name of this template.
      Returns:
      the name of this template
      Since:
      100.0.0
    • getPrototypeAttributes

      public Map<String,Object> getPrototypeAttributes()
      Gets the default attribute values used when creating a feature.
      Returns:
      the default attribute values used when creating a feature
      Since:
      100.0.0