public class

ArcGISFeatureLayer

extends GraphicsLayer
implements TimeAwareLayer PopupLayer
java.lang.Object
   ↳ com.esri.android.map.Layer
     ↳ com.esri.android.map.GraphicsLayer
       ↳ com.esri.android.map.ags.ArcGISFeatureLayer

Class Overview



ArcGISFeatureLayer is a special type of GraphicsLayer that allows you to display, select, query, and filter features in a layer hosted by an ArcGIS for Server map service or feature service. If the service layer is editable, you can also add, update, and delete features. This layer retrieves feature geometry and attributes from the feature service and draws them directly in the map, unlike ArcGISDynamicMapServiceLayer or ArcGISTiledMapServiceLayer which draw map images returned from map services. The layer can be either a spatial layer or a non-spatial table, depending on the type of service it is initialized from.

Instantiate an ArcGISFeatureLayer by passing in the REST endpoint URL of the service, and layer ArcGISFeatureLayer.MODE or ArcGISFeatureLayer.Options. This URL is usually formatted as follows:
http:<server:port>/<instance>/rest/services/<service>/MapServer/<layerid>
or
http:<server:port>/<instance>/rest/services/<service>/FeatureServer/<layerid>
ArcGISFeatureLayer.MODE determines how features will be fetched from the service, and should be selected based on the service content and expected usage.

Java usage:

 String URL = "http://sampleserver1.arcgisonline.com/ArcGIS/rest/services/Specialty/ESRI_StateCityHighway_USA/MapServer/0";
 ArcGISFeatureLayer fLayer = new ArcGISFeatureLayer(URL, MODE.ONDEMAND);
 

The layer inherits its symbology from the service for services hosted by ArcGIS for Server 10 or above; if the server version is older, you must assign a renderer for the feature layer to successfully symbolize the features. The layer automatically retrieves features from the service; do not directly add or remove any graphics from this type of layer.

Summary

Nested Classes
class ArcGISFeatureLayer.EditCapabilities Feature edit capabilities. 
enum ArcGISFeatureLayer.MODE The feature layer can work under 3 modes. 
class ArcGISFeatureLayer.Options The options to instantiate the feature layer. 
enum ArcGISFeatureLayer.SELECTION_METHOD The modes used for the select features method. 
[Expand]
Inherited Fields
From class com.esri.android.map.GraphicsLayer
From class com.esri.android.map.Layer
Public Constructors
ArcGISFeatureLayer(String url, ArcGISFeatureLayer.Options layerOption)
The constructor is used if you are instantiating the ArcGISFeatureLayer using Java code.
ArcGISFeatureLayer(String url, ArcGISFeatureLayer.Options layerOption, UserCredentials credentials)
The constructor is used if you are instantiating the ArcGISFeatureLayer using Java code.
ArcGISFeatureLayer(String url, ArcGISFeatureLayer.Options layerOption, UserCredentials credentials, boolean useAdvancedSymbols)
The constructor is used if you are instantiating the ArcGISFeatureLayer using Java code.
ArcGISFeatureLayer(String url, ArcGISFeatureLayer.Options layerOption, UserCredentials credentials, boolean useAdvancedSymbols, GraphicsLayer.RenderingMode rmode)
The constructor is used if you are instantiating the ArcGISFeatureLayer using Java code.
ArcGISFeatureLayer(String url, ArcGISFeatureLayer.MODE mode)
The constructor is used if you are instantiating the ArcGISFeatureLayer using Java code (see the class description for an example of this usage).
ArcGISFeatureLayer(String url, String layerDefinition, ArcGISFeatureLayer.MODE mode)
The constructor is used if you are instantiating the ArcGISFeatureLayer using Java code.
ArcGISFeatureLayer(String url, String layerDefinition, ArcGISFeatureLayer.MODE mode, boolean initLayer)
The constructor is used if you are instantiating the ArcGISFeatureLayer using Java code (see the class description for an example of this usage).
ArcGISFeatureLayer(String url, String layerDefinition, ArcGISFeatureLayer.MODE mode, boolean initLayer, UserCredentials credentials)
The constructor is used if you are instantiating the ArcGISFeatureLayer using Java code (see the class description for an example of this usage).
ArcGISFeatureLayer(String url, String layerDefinition, ArcGISFeatureLayer.MODE mode, boolean initLayer, UserCredentials credentials, boolean useAdvancedSymbols)
The constructor is used if you are instantiating the ArcGISFeatureLayer using Java code (see the class description for an example of this usage).
ArcGISFeatureLayer(String url, String layerDefinition, ArcGISFeatureLayer.MODE mode, boolean initLayer, UserCredentials credentials, boolean useAdvancedSymbols, GraphicsLayer.RenderingMode rmode)
The constructor is used if you are instantiating the ArcGISFeatureLayer using Java code (see the class description for an example of this usage).
ArcGISFeatureLayer(String url, ArcGISFeatureLayer.MODE mode, UserCredentials credentials)
The constructor is used if you are instantiating the ArcGISFeatureLayer using Java code.
ArcGISFeatureLayer(String layerDefinition, FeatureSet featureCollection, ArcGISFeatureLayer.Options layerOption)
The constructor is used if you are instantiating the ArcGISFeatureLayer using a feature collection.
ArcGISFeatureLayer(String layerDef, String layerDefinitionOverride, FeatureSet featureCollection, ArcGISFeatureLayer.Options layerOption, boolean initLayer)
This constructor is to be used with a mapnotes layer defined in webmap only.
Public Methods
void addAttachment(int objectId, File file, CallbackListener<FeatureEditResult> callback)
Adds an attachment to the feature specified by the ObjectId.
void addAttachment(int objectId, File file, String mime, CallbackListener<FeatureEditResult> callback)
Adds an attachment to the feature specified by the ObjectId.
void applyEdits(Graphic[] adds, Graphic[] deletes, Graphic[] updates, CallbackListener<FeatureEditResult[][]> callback)
Applies edits to the editable feature layer.
void clear()
Clears all selection and removes all graphics from the layer.
void clearPersistedGraphics()
Clears the list of graphics to persist.
void clearSelection()
Clears the current selection.
Graphic createFeatureWithTemplate(FeatureTemplate template, Geometry geometry)
Creates a new feature based on the specified feature SubType and feature template.
Graphic createFeatureWithType(FeatureType type, Geometry geometry)
Creates a new feature based on the specified feature SubType.
ArcGISPopupInfo createPopupInfo()
Creates the popup info.
void deleteAttachments(int objectId, int[] attachmentids, CallbackListener<FeatureEditResult[]> callback)
Deletes one or more attachments for the feature specified by the input ObjectId.
double getBufferFactor()
Returns the factor used to calculate buffered extent.
LayerServiceCapabilities getCapabilities()
Gets the capabilities object of the associated feature service.
double getConstraintFactor()
Returns the constraint factor that is used to determine whether a layer should be requeried when in OnDemand mode.amount.
String getDefaultDefinitionExpression()
Returns the Metadata describing the default definition expression for the layer as defined by the service.
String getDefinitionExpression()
Returns the current definition expression.
String getDisplayField()
Returns the name of the field that contains the Display Field for the layer.
ArcGISFeatureLayer.EditCapabilities getEditCapabilities(Graphic graphic)
Gets the edit capabilities for a graphic.
EditFieldsInfo getEditFieldsInfo()
Gets the edit fields info.
EditInfo getEditInfo(Graphic graphic, EditInfo.ACTION_TYPE action)
Gets the available editing information for the graphic.
int getExpirationInterval()
Returns the time interval in seconds that features in the layer will expire when the layer is in ONDEMAND mode.
Field getField(String fieldName)
This method returns the field object when the fieldname is passed in.
Field[] getFields()
The array of fields in the layer.
Geometry.Type getGeometryType()
Gets the type of the geometry holding by the feature layer.
String getGlobalIdField()
Returns the name of the field that contains the GlobalId field for the layer.
int getGraphicIDWithOID(int oid)
Returns the local unique ID of the graphic with the corresponding object ID if it exists locally, or -1 otherwise.
Map<Integer, Integer> getGraphicIDsWithOIDs(int[] oids)
Returns a map of object IDs to their corresponding local unique IDs for graphics that exist locally, or mapped to -1 otherwise.
LayerServiceInfo getLayerServiceInfo()
Returns LayerServiceInfo.
ArcGISFeatureLayer.MODE getMode()
Returns the layer mode.
String getObjectIdField()
Returns the name of the field that contains the ObjectID field for the layer.
String[] getOutFields()
The array of field names included in the feature layer based on the ArcGISFeatureLayer.Options.outFields parameter.
OwnershipBasedAccessControlForFeatures getOwnershipBasedAccessControlForFeatures()
Gets the ownership based access control for features.
ArcGISPopupInfo getPopupInfo(int sublayerId)
Gets the PopupInfo associated with the sub-layer id.
ArcGISPopupInfo getPopupInfo()
Gets the PopupInfo associated with this feature layer.
final String getQueryUrl(int subLayerId)
Returns the query url, the subLayerId should match the feature layer id.
Graphic[] getSelectedFeatures()
Returns the selected features.
Symbol getSelectionSymbol()
Returns the selection symbol for the feature layer.
FeatureTemplate[] getTemplates()
Returns an array of feature templates defined in the feature service layer.
TimeExtent getTimeExtent()
Gets the valid TimeExtent object for the Layer or null if this service does not support time based queries.
TimeInfo getTimeInfo()
Get all the time awareness information for this layer.
TimeExtent getTimeInterval()
Get the current date/time range that this layer is filtered by.
FeatureType getType(String type)
Gets the type.
String getTypeIdField()
Returns the name of the field that contains the SubType field for the layer.
FeatureType[] getTypes()
Returns an array of feature types defined in the feature service layer.
boolean hasAttachments()
True if attachments are enabled on the feature layer.
boolean isAllowGeometryUpdates()
Returns true if the geometry of the features in the layer can be edited.
boolean isAutoRefreshOnExpiration()
True if the layer will refresh automatically when the expiration interval is reached.
boolean isEditable()
Returns true if the feature layer is editable.
boolean isLastQueryExceededTransferLimit()
ArcGIS 10.1 and above supports a property regarding the transfer limit of the server.
boolean isPopupAllowGeometryUpdate(Feature feature)
Returns true if this PopupView is editable, false otherwise.
boolean isPopupDeletable(Feature feature)
Returns true if this Popup is deletable, false otherwise.
boolean isPopupEditable(Feature feature)
Returns true if this Popup is editable, false otherwise.
boolean isRequeryIfExceededTransferLimit()
By default, when panning around, as long as you pan within a buffer, requeries will not be made.
boolean isTable()
Returns true if the type of layer is "Table".
boolean isTimeAware()
Indicates whether or not this particular layer instance is time aware.
void queryAttachmentInfos(int objectId, CallbackListener<AttachmentInfo[]> callback)
Queries for information about attachments associated with the specified ObjectIds.
void queryFeatures(Query query, CallbackListener<FeatureSet> callback)
Query features from the feature layer.
void queryIds(Query query, CallbackListener<int[]> callback)
Query for ObjectIds.
void recycle()
Releases resources referenced by the Layer so that they can be recycled.
void refresh()
Based on the mode of the feature layer, the method call can update the graphics from the associate service or refresh the layer from local cache.
void removeAll()
Removes all graphics.
void removeGraphic(int id)
Removes graphic using a unique ID.
InputStream retrieveAttachment(int objectId, int attachmentId)
Fetches the contents of the specified attachment.
void selectFeatures(Query query, ArcGISFeatureLayer.SELECTION_METHOD selectionMethod, CallbackListener<FeatureSet> callback)
Selects features from the feature layer.
void setAutoRefreshOnExpiration(boolean autoRefreshOnExpiration)
Specifies whether or not the layer will refresh automatically when the expiration interval is reached.
void setBufferFactor(double bufferFactor)
Sets the factor used to calculate buffered extent.
void setConstraintFactor(double constraint)
Constraint factor is used when the feature layer is in OnDemand mode.
void setDefinitionExpression(String expression)
Sets the definition expression of the feature layer.
void setExpirationInterval(int expirationInterval)
The time interval in seconds that features in the layer will expire when the layer is in ONDEMAND mode.
void setGraphicVisible(int uid, boolean visible)
Sets the graphic's visibility for the specified unique id
void setPersistedGraphics(int[] ids, boolean persisted)
Sets a list of graphic ids to be either persisted or not persisted.
void setPopupInfos(Map<Integer, ArcGISPopupInfo> popUpInfos)
Sets the popup infos.
void setRequeryIfExceededTransferLimit(boolean requeryIfExceededLimit)
By default, when panning around, as long as you pan within a buffer, requeries will not be made.
void setSelectedGraphics(int[] ids, boolean selected)
Selects the graphics with the supplied ids.
void setSelectionSymbol(Symbol selectionSymbol)
Sets the selection symbol for the feature layer.
void setTimeInterval(TimeExtent timeExtent)
Set the current date/time range that this layer will be filtered by.
Protected Methods
void finalize()
void initLayer()
Initializes the layer.
void initialUpdate()
Called when ArcGISFeatureLayer updates its content very first time.
void updateSpatialReferenceStatus(int SRStatus)
The callback method is invoked when the layer is added to map.
[Expand]
Inherited Methods
From class com.esri.android.map.GraphicsLayer
From class com.esri.android.map.Layer
From class java.lang.Object
From interface com.esri.core.map.TimeAwareLayer
From interface com.esri.android.map.popup.PopupLayer

Public Constructors

public ArcGISFeatureLayer (String url, ArcGISFeatureLayer.Options layerOption)

The constructor is used if you are instantiating the ArcGISFeatureLayer using Java code.

Parameters
url String: the the URL of the feature layer service.
layerOption ArcGISFeatureLayer.Options: the option parameters. Sets to null to use the default options.

public ArcGISFeatureLayer (String url, ArcGISFeatureLayer.Options layerOption, UserCredentials credentials)

The constructor is used if you are instantiating the ArcGISFeatureLayer using Java code.

Parameters
url String: the the URL of the feature layer service.
layerOption ArcGISFeatureLayer.Options: the option parameters. Sets to null to use the default options.
credentials UserCredentials: the user credentials for accessing a secure feature layer.

public ArcGISFeatureLayer (String url, ArcGISFeatureLayer.Options layerOption, UserCredentials credentials, boolean useAdvancedSymbols)

The constructor is used if you are instantiating the ArcGISFeatureLayer using Java code.

Parameters
url String: the the URL of the feature layer service.
layerOption ArcGISFeatureLayer.Options: the option parameters. Sets to null to use the default options.
credentials UserCredentials: the user credentials for accessing a secure feature layer.
useAdvancedSymbols boolean: if the feature service support advanced(CIM) symbols, set the parameter be true to use symbologies to render features.

public ArcGISFeatureLayer (String url, ArcGISFeatureLayer.Options layerOption, UserCredentials credentials, boolean useAdvancedSymbols, GraphicsLayer.RenderingMode rmode)

The constructor is used if you are instantiating the ArcGISFeatureLayer using Java code.

Parameters
url String: the the URL of the feature layer service.
layerOption ArcGISFeatureLayer.Options: the option parameters. Sets to null to use the default options.
credentials UserCredentials: the user credentials for accessing a secure feature layer.
useAdvancedSymbols boolean: if the feature service support advanced(CIM) symbols, set the parameter be true to use symbologies to render features.
rmode GraphicsLayer.RenderingMode

public ArcGISFeatureLayer (String url, ArcGISFeatureLayer.MODE mode)

The constructor is used if you are instantiating the ArcGISFeatureLayer using Java code (see the class description for an example of this usage).

Parameters
url String: the the URL of the feature layer service.
mode ArcGISFeatureLayer.MODE: the feature layer mode.

public ArcGISFeatureLayer (String url, String layerDefinition, ArcGISFeatureLayer.MODE mode)

The constructor is used if you are instantiating the ArcGISFeatureLayer using Java code. Do not call this constructor from the UI thread, because the layerDefinition JSON may specify a URL from which to fetch image data, in which case it will perform a network request on the current thread.

Parameters
url String: the the URL of the feature layer service.
layerDefinition String: The definition of the layer represented in a JSON String. The structure is the same as the information returned by REST for a layer in a feature or map service.
mode ArcGISFeatureLayer.MODE: the feature layer mode.

public ArcGISFeatureLayer (String url, String layerDefinition, ArcGISFeatureLayer.MODE mode, boolean initLayer)

The constructor is used if you are instantiating the ArcGISFeatureLayer using Java code (see the class description for an example of this usage). Do not call this constructor from the UI thread, because the layerDefinition JSON may specify a URL from which to fetch image data, in which case it will perform a network request on the current thread.

Parameters
url String: the the URL of the feature layer service.
layerDefinition String: The definition of the layer represented in a JSON String. The structure is the same as the information returned by REST for a layer in a feature or map service.
mode ArcGISFeatureLayer.MODE: the feature layer mode.
initLayer boolean: set to true to initialize the the layer, or the layer will not initialized.

public ArcGISFeatureLayer (String url, String layerDefinition, ArcGISFeatureLayer.MODE mode, boolean initLayer, UserCredentials credentials)

The constructor is used if you are instantiating the ArcGISFeatureLayer using Java code (see the class description for an example of this usage). Do not call this constructor from the UI thread, because the layerDefinition JSON may specify a URL from which to fetch image data, in which case it will perform a network request on the current thread.

Parameters
url String: the the URL of the feature layer service.
layerDefinition String: The definition of the layer represented in a JSON String. The structure is the same as the information returned by REST for a layer in a feature or map service.
mode ArcGISFeatureLayer.MODE: the feature layer mode.
initLayer boolean: set to true to initialize the the layer, or the layer will not initialized.
credentials UserCredentials: the user credentials for accessing a secure feature layer.

public ArcGISFeatureLayer (String url, String layerDefinition, ArcGISFeatureLayer.MODE mode, boolean initLayer, UserCredentials credentials, boolean useAdvancedSymbols)

The constructor is used if you are instantiating the ArcGISFeatureLayer using Java code (see the class description for an example of this usage). Do not call this constructor from the UI thread, because the layerDefinition JSON may specify a URL from which to fetch image data, in which case it will perform a network request on the current thread.

Parameters
url String: the the URL of the feature layer service.
layerDefinition String: The definition of the layer represented in a JSON String. The structure is the same as the information returned by REST for a layer in a feature or map service.
mode ArcGISFeatureLayer.MODE: the feature layer mode.
initLayer boolean: set to true to initialize the the layer, or the layer will not initialized.
credentials UserCredentials: the user credentials for accessing a secure feature layer.
useAdvancedSymbols boolean: if the feature service support advanced(CIM) symbols, set the parameter be true to use symbologies to render features.

public ArcGISFeatureLayer (String url, String layerDefinition, ArcGISFeatureLayer.MODE mode, boolean initLayer, UserCredentials credentials, boolean useAdvancedSymbols, GraphicsLayer.RenderingMode rmode)

The constructor is used if you are instantiating the ArcGISFeatureLayer using Java code (see the class description for an example of this usage). Do not call this constructor from the UI thread, because the layerDefinition JSON may specify a URL from which to fetch image data, in which case it will perform a network request on the current thread.

Parameters
url String: the the URL of the feature layer service.
layerDefinition String: The definition of the layer represented in a JSON String. The structure is the same as the information returned by REST for a layer in a feature or map service.
mode ArcGISFeatureLayer.MODE: the feature layer mode.
initLayer boolean: set to true to initialize the the layer, or the layer will not initialized.
credentials UserCredentials: the user credentials for accessing a secure feature layer.
useAdvancedSymbols boolean: if the feature service support advanced(CIM) symbols, set the parameter be true to use symbologies to render features.
rmode GraphicsLayer.RenderingMode: the rendering mode for the feature layer.

public ArcGISFeatureLayer (String url, ArcGISFeatureLayer.MODE mode, UserCredentials credentials)

The constructor is used if you are instantiating the ArcGISFeatureLayer using Java code.

Parameters
url String: the the URL of the feature layer service.
mode ArcGISFeatureLayer.MODE: the feature layer mode.
credentials UserCredentials: the user credentials for accessing a secure feature layer.

public ArcGISFeatureLayer (String layerDefinition, FeatureSet featureCollection, ArcGISFeatureLayer.Options layerOption)

The constructor is used if you are instantiating the ArcGISFeatureLayer using a feature collection.

The feature layer, when initialized with a feature collection object has the following behavior:

  • Edits are applied on the client not posted to the server.
  • The feature layer generates a unique ObjectId for new features.
  • All queries are done on the client side.
  • Does not support operations that need to be performed on the server, e.g. attachment, appyEdit.

You need to explicitly call clear() to release all cached feature collection when not needed.

Do not call this constructor from the UI thread, because the layerDefinition JSON may specify a URL from which to fetch image data, in which case it will perform a network request on the current thread.

Parameters
layerDefinition String: The definition of the layer represented in a JSON String. The structure is the same as the information returned by REST for a layer in a feature or map service.
featureCollection FeatureSet: A collection of features. The spatial reference of the features must be same as the map's.
layerOption ArcGISFeatureLayer.Options: the option parameters. Sets to null to use the default options.

public ArcGISFeatureLayer (String layerDef, String layerDefinitionOverride, FeatureSet featureCollection, ArcGISFeatureLayer.Options layerOption, boolean initLayer)

This constructor is to be used with a mapnotes layer defined in webmap only. Do not call this constructor from the UI thread, because layer definition JSON may specify a URL from which to fetch image data, in which case it will perform a network request on the current thread.

Parameters
layerDef String: the definition of the map notes layer represented in a JSON String. The structure is the same as the information returned by REST for a layer in a feature or map service.
layerDefinitionOverride String: the definition of the feature layer represented in a JSON String. The structure is the same as the information returned by REST for a layer in a feature or map service.
featureCollection FeatureSet: the mapnotes layer
layerOption ArcGISFeatureLayer.Options: option parameters.
initLayer boolean: set to true to initialize the the layer, or the layer will not initialized.

Public Methods

public void addAttachment (int objectId, File file, CallbackListener<FeatureEditResult> callback)

Adds an attachment to the feature specified by the ObjectId. Only applicable if isEditable() and

Parameters
objectId int: The ObjectId of the feature to which the attachment is added.
file File: The path of the attachment on the device.
callback CallbackListener: The path of the attachment on the device. hasAttachments() are true.

public void addAttachment (int objectId, File file, String mime, CallbackListener<FeatureEditResult> callback)

Adds an attachment to the feature specified by the ObjectId. Only applicable if isEditable() and

Parameters
objectId int: The ObjectId of the feature to which the attachment is added.
file File: The path of the attachment on the device.
mime String: the content-type to send the file. e.g. text/plain. When mime is omitted the content-type is determined by the file extension of the attachment. By default the content-type is "application/octet-stream".
callback CallbackListener: The path of the attachment on the device. hasAttachments() are true.

public void applyEdits (Graphic[] adds, Graphic[] deletes, Graphic[] updates, CallbackListener<FeatureEditResult[][]> callback)

Applies edits to the editable feature layer. Only applicable for layers in a feature service.

  • For new features, the applyEdit will submit all the features to server side. If succeed, all of the new features will be updated with the OID and GID and will be added to the layer graphics.
  • For updating and deleting, the graphics will be adjusted based on the response.

    Parameters
    adds Graphic: Array of features to be added.
    deletes Graphic: Array of features to be deleted. Features must have valid ObjectIds.
    updates Graphic: Array of features whose geometry and/or attributes have changed. Features must have valid ObjectIds.
    callback CallbackListener: This listener will be called when the operation is complete or on error. The parameter passed to onCallback() is a matrix containing the results of the edits. It is structured as follows: matrix[0] contains an array of the results of the feature additions. matrix[1] contains an array of the results of the feature deletions. matrix[2] contains an array of the results of the feature updates. For example, matrix[2][0] contains the result of applying the first element of updates.
  • public void clear ()

    Clears all selection and removes all graphics from the layer.

    public void clearPersistedGraphics ()

    Clears the list of graphics to persist. Once cleared, the graphics will be removed on the next requery.

    public void clearSelection ()

    Clears the current selection.

    public Graphic createFeatureWithTemplate (FeatureTemplate template, Geometry geometry)

    Creates a new feature based on the specified feature SubType and feature template. Note, the new feature is only available on the device at this point, it is not committed to the server.

    Parameters
    template FeatureTemplate: the feature template to use while creating the feature.
    geometry Geometry: the geometry to create the Graphic.
    Returns
    Graphic the Graphic with the given geometry and the template.

    public Graphic createFeatureWithType (FeatureType type, Geometry geometry)

    Creates a new feature based on the specified feature SubType. Note, the new feature is only available on the device at this point, it is not committed to the server. This method uses the first template in the feature type.

    Parameters
    type FeatureType: the type of feature to create.
    geometry Geometry: the geometry to create the Graphic.
    Returns
    Graphic the Graphic with the given geometry and the template (defined in the type).

    public ArcGISPopupInfo createPopupInfo ()

    Creates the popup info.

    Returns
    ArcGISPopupInfo the arc gis popup info

    public void deleteAttachments (int objectId, int[] attachmentids, CallbackListener<FeatureEditResult[]> callback)

    Deletes one or more attachments for the feature specified by the input ObjectId. Only applicable if

    Parameters
    objectId int: The ObjectId of the feature from which the attachment is removed.
    attachmentids int: The ObjectId of the feature from which the attachment is removed.
    callback CallbackListener: This listener will be called when the operation is complete or on error. isEditable() and hasAttachments() are true.

    public double getBufferFactor ()

    Returns the factor used to calculate buffered extent. When in ONDEMAND mode, you have a choice to fetch the features within current extent or buffered extent. The buffer is calculated as: width = (bufferFactor > 1) ? extent.width * bufferFactor : extent.width; height = (bufferFactor > 1) ? extent.height * bufferFactor : extent.height;

    By default it is 3.0 (three times the current extent)

    Returns
    double the buffer factor

    public LayerServiceCapabilities getCapabilities ()

    Gets the capabilities object of the associated feature service. It is an object with booleans of supported capabilities - e.g. "Query, Editing". Only available if the feature service is published using ArcGIS Server version 10 or greater. You cannot call this method until the layer is loaded.

    When the Feature layer is instantiated without an associated feature service (e.g. FeatureCollection Mode), the method will always return null.

    Returns
    LayerServiceCapabilities the layer service capabilities or null if the associated server doesn't support it.

    public double getConstraintFactor ()

    Returns the constraint factor that is used to determine whether a layer should be requeried when in OnDemand mode.amount. A value of 0 or less will never requery when the user zooms in within the buffered envelope A value of 1 will always requery when the user zooms in within the buffered envelope. The default value is 0.1 (one-tenth).

    Returns
    double The constraint factor

    public String getDefaultDefinitionExpression ()

    Returns the Metadata describing the default definition expression for the layer as defined by the service. The default definition expression limits the features available for display and query. You cannot override this value but you define additional filters on the default expression using the setDefinitionExpression(String) method. For example, if the default definition expression is set to display data where "STATE_NAME = 'California'" you could use setDefinitionExpression to only display a subset of the features in California e.g., "COUNTY='San Diego'".

    Returns
    String the default definition expression

    public String getDefinitionExpression ()

    Returns the current definition expression.

    Returns
    String the definition.

    public String getDisplayField ()

    Returns the name of the field that contains the Display Field for the layer.

    Returns
    String the name of the field.

    public ArcGISFeatureLayer.EditCapabilities getEditCapabilities (Graphic graphic)

    Gets the edit capabilities for a graphic.

    Parameters
    graphic Graphic: the graphic
    Returns
    ArcGISFeatureLayer.EditCapabilities the edit capabilities

    public EditFieldsInfo getEditFieldsInfo ()

    Gets the edit fields info.

    Returns
    EditFieldsInfo the editFieldsInfo

    public EditInfo getEditInfo (Graphic graphic, EditInfo.ACTION_TYPE action)

    Gets the available editing information for the graphic.

    Parameters
    graphic Graphic: the graphic to check.
    action EditInfo.ACTION_TYPE: the editing action.
    Returns
    EditInfo the editing information for the given graphic.

    public int getExpirationInterval ()

    Returns the time interval in seconds that features in the layer will expire when the layer is in ONDEMAND mode. Setting this to 0 will cause the features to not expire.

    Returns
    int interval in seconds

    public Field getField (String fieldName)

    This method returns the field object when the fieldname is passed in.

    Parameters
    fieldName String: name of the Field
    Returns
    Field the Field object

    public Field[] getFields ()

    The array of fields in the layer.

    Returns
    Field[] the field array.

    public Geometry.Type getGeometryType ()

    Gets the type of the geometry holding by the feature layer. You should not call this method until the layer is initialized.

    Returns
    Geometry.Type the geometry type or null if not initialized.

    public String getGlobalIdField ()

    Returns the name of the field that contains the GlobalId field for the layer.

    Returns
    String the name of the field.

    public int getGraphicIDWithOID (int oid)

    Returns the local unique ID of the graphic with the corresponding object ID if it exists locally, or -1 otherwise. The returned ID can be used with getGraphic(int) to retrieve the full graphic object.

    Parameters
    oid int: the object ID of the graphic
    Returns
    int the local unique id of the graphic

    public Map<Integer, Integer> getGraphicIDsWithOIDs (int[] oids)

    Returns a map of object IDs to their corresponding local unique IDs for graphics that exist locally, or mapped to -1 otherwise. The returned ID can be used with getGraphic(int) to retrieve the full graphic object.

    Parameters
    oids int
    Returns
    Map<Integer, Integer> a mapping of object IDs to their corresponding local unique IDs

    public LayerServiceInfo getLayerServiceInfo ()

    Returns LayerServiceInfo.

    Returns
    LayerServiceInfo LayerServiceInfo

    public ArcGISFeatureLayer.MODE getMode ()

    Returns the layer mode.

    Returns
    ArcGISFeatureLayer.MODE the mode

    public String getObjectIdField ()

    Returns the name of the field that contains the ObjectID field for the layer.

    Returns
    String the name of the field.

    public String[] getOutFields ()

    The array of field names included in the feature layer based on the ArcGISFeatureLayer.Options.outFields parameter. If none are specified, in the ArcGISFeatureLayer.Options class then the feature layer will return all fields and this methods will return null. If "*" was specified in the ArcGISFeatureLayer.Options class this method will return ["*"]. If some field names are set in the ArcGISFeatureLayer.Options class, but the ObjectId field was not included it will be included in the feature layer and will also be returned in this String array.

    Returns
    String[] the name of the fields

    public OwnershipBasedAccessControlForFeatures getOwnershipBasedAccessControlForFeatures ()

    Gets the ownership based access control for features.

    Returns
    OwnershipBasedAccessControlForFeatures the ownershipBasedAccessControlForFeatures

    public ArcGISPopupInfo getPopupInfo (int sublayerId)

    Gets the PopupInfo associated with the sub-layer id.

    Parameters
    sublayerId int: you should only set 0 for the feature layer.
    Returns
    ArcGISPopupInfo PopupInfo

    public ArcGISPopupInfo getPopupInfo ()

    Gets the PopupInfo associated with this feature layer.

    Returns
    ArcGISPopupInfo PopupInfo

    public final String getQueryUrl (int subLayerId)

    Returns the query url, the subLayerId should match the feature layer id.

    Parameters
    subLayerId int: the sub layer id
    Returns
    String the queryUrl for the sub-layer ID.

    See also:

    public Graphic[] getSelectedFeatures ()

    Returns the selected features.

    Returns
    Graphic[] the selected features.

    public Symbol getSelectionSymbol ()

    Returns the selection symbol for the feature layer. If no symbol is specified, features are drawn using the layers's renderer.

    Returns
    Symbol the symbol for highlight feature.

    public FeatureTemplate[] getTemplates ()

    Returns an array of feature templates defined in the feature service layer. Only applicable for ArcGIS Server feature service layers.

    Returns
    FeatureTemplate[] the array of FeatureTemplate.

    public TimeExtent getTimeExtent ()

    Gets the valid TimeExtent object for the Layer or null if this service does not support time based queries.

    Returns
    TimeExtent the valid range of dates for this layer.

    public TimeInfo getTimeInfo ()

    Get all the time awareness information for this layer.

    Returns
    TimeInfo the time awareness information as a TimeInfo object

    public TimeExtent getTimeInterval ()

    Get the current date/time range that this layer is filtered by.

    Returns
    TimeExtent the current date/time range

    public FeatureType getType (String type)

    Gets the type.

    Parameters
    type String: the type
    Returns
    FeatureType the type

    public String getTypeIdField ()

    Returns the name of the field that contains the SubType field for the layer.

    Returns
    String the name of the field.

    public FeatureType[] getTypes ()

    Returns an array of feature types defined in the feature service layer. Only applicable for ArcGIS Server feature service layers.

    Returns
    FeatureType[] the array of FeatureType.

    public boolean hasAttachments ()

    True if attachments are enabled on the feature layer. Use the queryAttachmentInfos(int, CallbackListener) method to determine if the feature has attachments. If the layer is editable ( isEditable()) and supports attachments the following operations can be performed.

  • Add attachments to features.
  • Delete existing attachments.

    Returns
    boolean true, if checks for attachments
  • public boolean isAllowGeometryUpdates ()

    Returns true if the geometry of the features in the layer can be edited. This property is only available on ArcGIS Server 10.1 and above.

    Returns
    boolean true if the feature geometry is editable.

    public boolean isAutoRefreshOnExpiration ()

    True if the layer will refresh automatically when the expiration interval is reached.

    Returns
    boolean true, if checks if is auto refresh on expiration

    public boolean isEditable ()

    Returns true if the feature layer is editable. If the layer is editable the following operations can be performed.

  • Add new features.
  • Modify the geometry and attributes of existing features.
  • Delete features. You need to wait until the layer initialization is done before calling this method.

    Returns
    boolean true if it is editable or false otherwise.
  • public boolean isLastQueryExceededTransferLimit ()

    ArcGIS 10.1 and above supports a property regarding the transfer limit of the server. This property will be true only if the number of records returned exceeds the maximum number configured by the server administrator.

    Returns
    boolean true if the limit was exceeded

    public boolean isPopupAllowGeometryUpdate (Feature feature)

    Returns true if this PopupView is editable, false otherwise.

    Parameters
    feature Feature: the feature
    Returns
    boolean true if this PopupView is editable, false otherwise

    public boolean isPopupDeletable (Feature feature)

    Returns true if this Popup is deletable, false otherwise.

    Parameters
    feature Feature: the feature
    Returns
    boolean true if this Popup is deletable, false otherwise

    public boolean isPopupEditable (Feature feature)

    Returns true if this Popup is editable, false otherwise.

    Parameters
    feature Feature: the feature
    Returns
    boolean true if this Popup is editable, false otherwise

    public boolean isRequeryIfExceededTransferLimit ()

    By default, when panning around, as long as you pan within a buffer, requeries will not be made. Only when you pan outside of the buffer is a requery made. If this property is set to true, and your last query exceeded the transfer limit set by the feature service, then your next pan will perform a requery, even if you are still within the buffer. Note that this feature is only supported on ArcGIS 10.1 and above.

    Returns
    boolean true if requeries will be performed when the transfer limit is exceeded

    public boolean isTable ()

    Returns true if the type of layer is "Table". The type of a feature layer can be "Graphic Layer" or "Table".

    Returns
    boolean true, if checks if is table

    public boolean isTimeAware ()

    Indicates whether or not this particular layer instance is time aware.

    Returns
    boolean True if this is a time aware layer, false otherwise.

    public void queryAttachmentInfos (int objectId, CallbackListener<AttachmentInfo[]> callback)

    Queries for information about attachments associated with the specified ObjectIds.

    Parameters
    objectId int: The ObjectId of the feature upon which the attachment information is queried.
    callback CallbackListener: This listener will be called when the operation is complete or on error.

    public void queryFeatures (Query query, CallbackListener<FeatureSet> callback)

    Query features from the feature layer. Layer definition and time definition are honored. Whenever possible the feature layer will perform the query on the client.

    Parameters
    query Query: The input query. The query object has the following restrictions to avoid conflicts between layer and map properties.
  • outFields specified by the query object are overridden by the outFields specified in the feature layer constructor.
  • The returnGeometry value specified by the query object is ignored and true is used.
  • The outSpatialReference set by the query object is ignored and the map's spatial reference is used.
  • callback CallbackListener: The function to call when the method has completed.

    public void queryIds (Query query, CallbackListener<int[]> callback)

    Query for ObjectIds. There is no limit on the number of ObjectIds that are returned from the server. Like queryFeatures this operation will perform queries on the client (browser) whenever possible.

    Parameters
    query Query: The input query. The query object has the following restrictions to avoid conflicts between layer and map properties.
  • outFields specified by the query object are overridden by the outFields specified in the feature layer constructor.
  • The returnGeometry value specified by the query object is ignored and true is used.
  • The outSpatialReference set by the query object is ignored and the map's spatial reference is used.
  • callback CallbackListener: The function to call when the method has completed.

    public void recycle ()

    Releases resources referenced by the Layer so that they can be recycled.

    public void refresh ()

    Based on the mode of the feature layer, the method call can update the graphics from the associate service or refresh the layer from local cache.

    public void removeAll ()

    Removes all graphics.

    public void removeGraphic (int id)

    Removes graphic using a unique ID.

    Parameters
    id int: Unique ID representing a Graphic.

    public InputStream retrieveAttachment (int objectId, int attachmentId)

    Fetches the contents of the specified attachment. Please make sure call the InputStream.close() after you get the data.

    Parameters
    objectId int: the ObjectId of the feature to which the attachment belongs.
    attachmentId int: the ID of the attachment to fetch.
    Returns
    InputStream the input stream
    Throws
    Exception the exception

    public void selectFeatures (Query query, ArcGISFeatureLayer.SELECTION_METHOD selectionMethod, CallbackListener<FeatureSet> callback)

    Selects features from the feature layer. The selection method defines how query results are passed to the selection. The feature layer will highlight the current selection if a selection symbol has been defined. Whenever possible, the feature layer will perform the query operation on the client side.

    Parameters
    query Query: The input query.
    selectionMethod ArcGISFeatureLayer.SELECTION_METHOD: the selection mode.
    callback CallbackListener: The function to call when the method is completed or on error.

    public void setAutoRefreshOnExpiration (boolean autoRefreshOnExpiration)

    Specifies whether or not the layer will refresh automatically when the expiration interval is reached. Default is false. This is used only in ONDEMAND mode.

    Parameters
    autoRefreshOnExpiration boolean: the auto refresh on expiration

    public void setBufferFactor (double bufferFactor)

    Sets the factor used to calculate buffered extent. When in ONDEMAND mode, you have a choice to fetch the features within current extent or buffered extent. The buffered extent is calculated as: width = (bufferFactor > 1) ? extent.width * bufferFactor : extent.width; height = (bufferFactor > 1) ? extent.height * bufferFactor : extent.height;

    By default it is 3.0 (three times the current extent)

    Parameters
    bufferFactor double: the buffer factor

    public void setConstraintFactor (double constraint)

    Constraint factor is used when the feature layer is in OnDemand mode. This property defines refresh with requery behavior for OnDemand mode when the user is zooming in. This property should be set to a fraction between 0 and 1. If the size of the envelope the user zooms in to is less than the specified fraction of the buffered envelope's size, then a requery will happen. For example: the constraintFactor is set to 0.1 (one-tenth), we have a buffered envelope of features that is 50 miles wide. The user zooms into an envelope that is 4 miles wide. Since the envelope the layer needs to draw is less than one-tenth the size of the buffered envelope, the feature layer will requery, even though the zoomed-to envelope is contained within the buffered envelope. This is useful is you have a service with a nmber of features that exceeeds the ArcGIS server query limit and you want the layer to requery when the user zooms in by a certain amount. A value of 0 or less will never requery when the user zooms in within the buffered envelope A value of 1 will always requery when the user zooms in within the buffered envelope. The default value is 0.1 (one-tenth).

    Parameters
    constraint double: The constraint fraction to set.

    public void setDefinitionExpression (String expression)

    Sets the definition expression of the feature layer. Only the features that match the definition expression are displayed. A definition expression limits the features available for display and queries by applying constraints to the layer's attribute fields. Setting a definition expression is useful when the dataset is large and you don't want to bring everything to the client for analysis. This method is typically called before adding the layer to the map. If the method is called after the layer is added to the map the layer will refresh itself to reflect the new definition expression.

    Parameters
    expression String: the definition expression.

    public void setExpirationInterval (int expirationInterval)

    The time interval in seconds that features in the layer will expire when the layer is in ONDEMAND mode. Setting this to 0 will cause the features to not expire.

    Parameters
    expirationInterval int: interval in seconds

    public void setGraphicVisible (int uid, boolean visible)

    Sets the graphic's visibility for the specified unique id

    Parameters
    uid int: The id of the graphic
    visible boolean: True to make the graphic visible, false to make it invisible.

    public void setPersistedGraphics (int[] ids, boolean persisted)

    Sets a list of graphic ids to be either persisted or not persisted. Persisted graphics will not be removed when a requery is performed outside of the graphics extent.

    Parameters
    ids int: The ids of the graphics to be persisted
    persisted boolean: Whether or not to persist the graphics

    public void setPopupInfos (Map<Integer, ArcGISPopupInfo> popUpInfos)

    Sets the popup infos.

    Parameters
    popUpInfos Map: the popup infos

    public void setRequeryIfExceededTransferLimit (boolean requeryIfExceededLimit)

    By default, when panning around, as long as you pan within a buffer, requeries will not be made. Only when you pan outside of the buffer is a requery made. If this property is set to true, and your last query exceeded the transfer limit set by the feature service, then your next pan will perform a requery, even if you are still within the buffer. Note that this feature is only supported on ArcGIS 10.1 and above.

    Parameters
    requeryIfExceededLimit boolean: whether to requery on exceeding transfer limit

    public void setSelectedGraphics (int[] ids, boolean selected)

    Selects the graphics with the supplied ids.

    Parameters
    ids int: the ids
    selected boolean: if true the graphic will be added to current selections, otherwise it will be unselected from current selection.

    public void setSelectionSymbol (Symbol selectionSymbol)

    Sets the selection symbol for the feature layer. If no symbol is specified, features are drawn using the layers's renderer.

    Parameters
    selectionSymbol Symbol: the selection symbol

    public void setTimeInterval (TimeExtent timeExtent)

    Set the current date/time range that this layer will be filtered by.

    Parameters
    timeExtent TimeExtent: the new date/time range

    Protected Methods

    protected void finalize ()

    Throws
    Throwable

    protected void initLayer ()

    Initializes the layer. The implementation should submit the OnStatusChangedListener.STATUS event accordingly.

    protected void initialUpdate ()

    Called when ArcGISFeatureLayer updates its content very first time.

    protected void updateSpatialReferenceStatus (int SRStatus)

    The callback method is invoked when the layer is added to map. 0 - Spatial Reference Invalid 1 - Spatial Reference NotNeeded 2 - Spatial Reference Projected 3 - Spatial Reference Good, -1 -layer loading failed (security etc. reasons).

    Parameters
    SRStatus int: an integer indicating the spatial reference status of layer