Packagecom.esri.ags.layers
Classpublic class FeatureLayer
InheritanceFeatureLayer Inheritance GraphicsLayer Inheritance Layer Inheritance mx.core.UIComponent
Subclasses CSVLayer

Since : ArcGIS API for Flex 2.0

The feature layer can be used to display features from one single layer of either a Feature Service or a Map Service. The layer can be either a (spatial) layer or a (non-spatial) table. The features in a FeatureLayer can be edited if the isEditable property is true.

If the layer supports attachment, the layerDetails (or tableDetails) "hasAttachment" property will be true. If the feature layer is editable and has attachments, you can also add and delete attachments.

The FeatureLayer will, by default, use the drawing information (symbology and domains) from the server (requires ArcGIS Server 10 or above). Note that the ArcGIS Desktop and Server uses symbol sizes in Point values, while Adobe Flex and the Flex API use pixels. Thus, a point that is setup to be 10 "points" in your mxd, will have a Flex symbol that is 13 pixels (based on the assumed 96 dpi).

Set the URL to the ArcGIS Server REST resource that represents a single layer or table, for example, http://sampleserver3.arcgisonline.com/ArcGIS/rest/services/SanFrancisco/311Incidents/MapServer/1. Note the number "1" at the end of the URL which indicates which specific layer you want to query. For more information on constructing a URL, see Using the ArcGIS Services Directory.

Note that FeatureLayer, like all layers, extend UIComponent and thus include basic mouse events, such as: click, mouseOut, mouseOver, and mouseDown, as well as other events like show and hide, and general properties, such as alpha, mouseChildren, toolTip and visible.

Default MXML PropertygraphicProvider

See also

com.esri.ags.events.LayerEvent
Concepts - Editing
Live sample - FeatureLayer based on a map service layer
Live sample - FeatureLayer based on a dynamic layer


Public Properties
 PropertyDefined By
 InheritedattributionVisible : Boolean
Indicates if this layer's attribution should be displayed.
Layer
 InheritedautoMoveGraphicsToTop : Boolean
If true, the Graphics will be moved to the top of the stack on mouseOver.
GraphicsLayer
 Inheritedclusterer : IClusterer
The graphics clusterer.
GraphicsLayer
 Inheritedcopyright : String
The layer's copyright text.
Layer
  definitionExpression : String
The definition expression limits the FeatureLayer to a subset of the available features in the map service layer.
FeatureLayer
  disableClientCaching : Boolean
If true, adds a timestamp parameter ("_ts") to the REST request to prevent the request from being loaded from the browser's cache.
FeatureLayer
  featureCollection : FeatureCollection
The featureCollection is used when you want to initialize the FeatureLayer with features from outside of ArcGIS Server.
FeatureLayer
  gdbVersion : String
Geodatabase version to use.
FeatureLayer
  graphicProvider : Object
[override] This inherited property returns an ArrayCollection of all the graphics currently in the layer, but unlike GraphicsLayer, this should be treated as a read-only property and modifications to the returned ArrayCollection are ignored.
FeatureLayer
 InheritedinfoWindowRenderer : IFactory
The info renderer.
GraphicsLayer
 InheritedinitialExtent : Extent
[override] Initial extent of the layer.
GraphicsLayer
  isEditable : Boolean
True if the FeatureLayer is editable, for example pointing to an editable layer in a FeatureService.
FeatureLayer
 InheritedisInScaleRange : Boolean
[read-only] Returns true if the current scale of the map is between the maximum and minimum scale of the layer.
Layer
  layerDetails : LayerDetails
[read-only] Detailed information about a layer in a map or feature service.
FeatureLayer
 Inheritedloaded : Boolean
[read-only] When the layer is loaded, the value becomes "true" and layer properties can be accessed.
Layer
 InheritedloadFault : Fault
[read-only] A reference to the fault that is dispatched when the layer throws a loadError event.
Layer
 Inheritedmap : Map
[read-only] A reference to the Map this layer is in.
Layer
  maxAllowableOffset : Number
The maximum allowable offset used for generalizing geometries.
FeatureLayer
 InheritedmaxScale : Number
The maximum scale of the layer.
Layer
 InheritedminScale : Number
The minimum scale of the layer.
Layer
  mode : String
Query mode for a feature layer.
FeatureLayer
 InheritednumGraphics : int
[read-only] Gets the number of graphics in that layer.
GraphicsLayer
  onDemandCacheSize : uint
When the query mode is MODE_ON_DEMAND and there are more than this number of features loaded, features that are not selected and are not in the current extent are removed in FIFO order (first in, first out).
FeatureLayer
  outFields : Array
Attribute fields to include in the FeatureSet.
FeatureLayer
  proxyURL : String
The URL to proxy the request through.
FeatureLayer
 InheritedrefreshInterval : Number
Refresh interval of the layer in minutes.
Layer
 Inheritedrenderer : IRenderer
The renderer allows for the symbol of the graphic to be dynamically picked - for example based on attributes or position of the graphic, or based on the scale of the map, or anything else.
GraphicsLayer
  requestTimeout : int
The request timeout in seconds.
FeatureLayer
  returnM : Boolean
If true, M values will be included in the geometry if the features have M values.
FeatureLayer
  returnZ : Boolean
If true, Z values will be included in the geometry if the features have Z values.
FeatureLayer
  selectedFeatures : Array
[read-only] The features in the current selection of this feature layer.
FeatureLayer
  selectionColor : Number
Selection color to highlight the currently selected features.
FeatureLayer
  selectionSymbol : Symbol
Selection symbol used to render the currently selected features.
FeatureLayer
 InheritedshowInLegend : Boolean
Indicates if this layer should be displayed in the Legend component or PrintTask output.
Layer
  source : ILayerSource
The dynamic layer source.
FeatureLayer
 InheritedspatialReference : SpatialReference
[override] The spatial reference of the map layer.
GraphicsLayer
 Inheritedsymbol : Symbol
The default symbol for the layer.
GraphicsLayer
  tableDetails : TableDetails
[read-only] Detailed information about a table in a map or feature service.
FeatureLayer
  timeDefinition : TimeExtent
Defines the time extent of features loaded in snapshot mode.
FeatureLayer
  timeOffset : Number
The time offset for the layer.
FeatureLayer
  timeOffsetUnits : String
The units of the timeOffset.
FeatureLayer
  token : String
Token for accessing a secure ArcGIS service.
FeatureLayer
  trackIdField : String
The field that contains the trackId.
FeatureLayer
  url : String
URL to the ArcGIS Server REST resource that represents a feature layer.
FeatureLayer
  useAMF : Boolean
Use AMF when loading features and for queryFeatures(), queryRelatedFeatures() and selectFeatures().
FeatureLayer
  useMapTime : Boolean
If true and the layer is time aware, the layer will be updated whenever the map's timeExtent changes.
FeatureLayer
  userId : String
User associated with a secure ArcGIS service.
FeatureLayer
Protected Properties
 PropertyDefined By
 InheritedrotatedMapExtent : Extent
[read-only] Extent of the layer in the rotated map.
Layer
Public Methods
 MethodDefined By
  
FeatureLayer(url:String = null, proxyURL:String = null, token:String = null)
Creates a new FeatureLayer object.
FeatureLayer
  
add(graphic:Graphic):String
[override] The add() method is not supported for FeatureLayer, use applyEdits() to add features to a FeatureLayer.
FeatureLayer
  
addAttachment(objectId:Number, data:ByteArray, name:String, contentType:String = null, responder:IResponder = null):AsyncToken
Add attachment to a feature (using its ObjectID).
FeatureLayer
  
applyEdits(adds:Array, updates:Array, deletes:Array, rollbackOnFailure:Boolean = false, responder:IResponder = null):AsyncToken
Saves edits on the server.
FeatureLayer
  
clear():void
[override] clear() is not supported.
FeatureLayer
  
Clears the current selection set.
FeatureLayer
  
deleteAttachments(objectId:Number, attachmentIds:Array, rollbackOnFailure:Boolean = false, responder:IResponder = null):AsyncToken
Delete one or more attachments for a feature.
FeatureLayer
  
getEditSummary(graphic:Graphic):String
Returns a localized summary of the last edit operation performed on the given feature, if available.
FeatureLayer
 Inherited
getLegendInfos(responder:IResponder = null):AsyncToken
Gets legend infos.
GraphicsLayer
  
isDeleteAllowed(graphic:Graphic):Boolean
Determines whether the specified graphic can be deleted by taking into account the ownership-based access control.
FeatureLayer
  
isUpdateAllowed(graphic:Graphic):Boolean
Determines whether the specified graphic can be updated by taking into account the ownership-based access control.
FeatureLayer
 Inherited
moveToTop(graphic:Graphic):void
Moves a specific graphic to the top of the stack.
GraphicsLayer
  
queryAttachmentInfos(objectId:Number, responder:IResponder = null):AsyncToken
Information about attachment(s) for a specific ObjectID.
FeatureLayer
  
queryCount(parameters:Query, responder:IResponder = null):AsyncToken
Gets the count of features that satisfy the input query.
FeatureLayer
  
queryFeatures(parameters:Query, responder:IResponder = null):AsyncToken
Query features from the feature layer.
FeatureLayer
  
queryIds(parameters:Query, responder:IResponder = null):AsyncToken
Query for object IDs.
FeatureLayer
  
queryRelatedFeatures(parameters:RelationshipQuery, responder:IResponder = null):AsyncToken
Query related features from this feature layer.
FeatureLayer
 Inherited
refresh():void
Causes the layer to redraw or reload its content.
Layer
  
remove(graphic:Graphic):void
[override] remove() is not supported.
FeatureLayer
  
selectFeatures(query:Query, selectionMethod:String = new, responder:IResponder = null):AsyncToken
Sets or modifies the current set of selected features.
FeatureLayer
Protected Methods
 MethodDefined By
 Inherited
Adds listeners for ExtentEvent.EXTENT_CHANGE, ZoomEvent.ZOOM_START, ZoomEvent.ZOOM_UPDATE and ZoomEvent.ZOOM_END.
Layer
 Inherited
When an EXTENT_CHANGE event occurs, this calls invalidateLayer();
Layer
 Inherited
hideHandler(event:FlexEvent):void
When the layer is hidden (visible is set to false), this calls removeMapListeners().
Layer
 Inherited
Subclasses should call this whenever they would like to have updateLayer() called on them.
Layer
 Inherited
Removes all the layers children.
Layer
 Inherited
Removes the four event listeners added by addMapListeners();
Layer
 Inherited
setLoaded(value:Boolean):void
Subclasses must call this when they've loaded all their properties and are ready to load their content.
Layer
 Inherited
showHandler(event:FlexEvent):void
When the layer is shown (visible is set to true), this calls addMapListeners() and invalidateLayer().
Layer
 Inherited
toScreenX(mapX:Number):Number
Converts the x-coordinate of map point to a screen point.
Layer
 Inherited
toScreenXY(mapX:Number, mapY:Number):Point
Converts map coordinates to screen coordinates.
Layer
 Inherited
toScreenY(mapY:Number):Number
Converts the y-coordinate of map point to a screen point.
Layer
 Inherited
Subclasses must override this method.
Layer
 Inherited
Finishes the zoom animation.
Layer
 Inherited
Prepares the zoom animation by taking a bitmap of the layer.
Layer
 Inherited
Redraws the bitmap of the layer.
Layer
Events
 Event Summary Defined By
  Dispatched when an addAttachment operation successfully completes.FeatureLayer
  Dispatched when a deleteAttachments operation successfully completes.FeatureLayer
  Dispatched when an applyEdits operation successfully completes.FeatureLayer
  Dispatched when applyEdits is called, but before the edits request is sent to the server.FeatureLayer
  Dispatched when a FeatureLayer operation fails.FeatureLayer
 InheritedFires when a graphic is added to the GraphicsLayer.GraphicsLayer
 InheritedFires when a graphic is removed from the GraphicsLayer.GraphicsLayer
 InheritedFires when all graphics in the GraphicsLayer are cleared.GraphicsLayer
 InheritedFires if the value of isInScaleRange changes.Layer
 InheritedFires after layer properties for the layer are successfully populated.Layer
 InheritedFires if the layer is unable to load.Layer
  Dispatched when a queryAttachmentInfos operation successfully completes.FeatureLayer
  Dispatched when a queryCount operation successfully completes.FeatureLayer
  Dispatched when a queryFeatures operation successfully completes.FeatureLayer
  Dispatched when a queryIds operation successfully completes.FeatureLayer
  Dispatched when the FeatureLayer could not draw all the features due to a maxRecordCount limitation on a query operation.FeatureLayer
  Dispatched when a queryRelatedFeatures operation successfully completes.FeatureLayer
  Dispatched when a clearSelection operation successfully completes.FeatureLayer
  Dispatched when a selectFeatures operation successfully completes.FeatureLayer
 InheritedFires when the layer has finished updating its content.Layer
 InheritedFires when the layer begins to update its content.Layer
Public Constants
 ConstantDefined By
  MODE_ON_DEMAND : String = onDemand
[static] Features will be retrieved as needed, when extent, time and layer definition changes..
FeatureLayer
  MODE_SELECTION : String = selection
[static] Only selected features will be retrieved from the server and be stored in memory on the client.
FeatureLayer
  MODE_SNAPSHOT : String = snapshot
[static] All features will be retrieved from server and stored in memory on the client.
FeatureLayer
  SELECTION_ADD : String = add
[static] Adds features to current set of selected features.
FeatureLayer
  SELECTION_NEW : String = new
[static] Creates a new set of selected features.
FeatureLayer
  SELECTION_SUBTRACT : String = subtract
[static] Removes features from the current set of selected features.
FeatureLayer
Property Detail
definitionExpressionproperty
definitionExpression:String

The definition expression limits the FeatureLayer to a subset of the available features in the map service layer. It is similar to the definition query for a layer in ArcMap.

When using definitionExpression while editing, you will only see your added and modified features if the new or updated feature is part of the definitionExpression.

This property can be used as the source for data binding.


Implementation
    public function get definitionExpression():String
    public function set definitionExpression(value:String):void

See also

disableClientCachingproperty 
disableClientCaching:Boolean

If true, adds a timestamp parameter ("_ts") to the REST request to prevent the request from being loaded from the browser's cache.

The default value is false.

This property can be used as the source for data binding.


Implementation
    public function get disableClientCaching():Boolean
    public function set disableClientCaching(value:Boolean):void
featureCollectionproperty 
featureCollection:FeatureCollection

The featureCollection is used when you want to initialize the FeatureLayer with features from outside of ArcGIS Server. The feature layer, when initialized with a featureCollection has the following behavior:

This property can be used as the source for data binding.


Implementation
    public function get featureCollection():FeatureCollection
    public function set featureCollection(value:FeatureCollection):void

See also

gdbVersionproperty 
gdbVersion:String

Since : ArcGIS API 3.0 for Flex

Geodatabase version to use. Requires ArcGIS 10.1 or later (and versioned data).

This property can be used as the source for data binding.


Implementation
    public function get gdbVersion():String
    public function set gdbVersion(value:String):void
graphicProviderproperty 
graphicProvider:Object[override]

This inherited property returns an ArrayCollection of all the graphics currently in the layer, but unlike GraphicsLayer, this should be treated as a read-only property and modifications to the returned ArrayCollection are ignored.


Implementation
    public function get graphicProvider():Object
    public function set graphicProvider(value:Object):void
isEditableproperty 
isEditable:Boolean

True if the FeatureLayer is editable, for example pointing to an editable layer in a FeatureService.

This property can be used as the source for data binding.


Implementation
    public function get isEditable():Boolean
    public function set isEditable(value:Boolean):void
layerDetailsproperty 
layerDetails:LayerDetails  [read-only]

Detailed information about a layer in a map or feature service.

This property can be used as the source for data binding.


Implementation
    public function get layerDetails():LayerDetails
maxAllowableOffsetproperty 
maxAllowableOffset:Number

The maximum allowable offset used for generalizing geometries. The units are the same as the returned features. Only applicable for layers that are not editable.

This property can be used as the source for data binding.


Implementation
    public function get maxAllowableOffset():Number
    public function set maxAllowableOffset(value:Number):void
modeproperty 
mode:String

Query mode for a feature layer. See the MODE_* constants for possible values. The default mode is to query on demand as the extent, time and layer definition changes. The snapshot mode will make one up-front request for all the features.

The onDemand mode - MODE_ON_DEMAND - features are fetched from the server as they are needed.

The snapshot mode - MODE_SNAPSHOT - features are fetched from the server based on definitionExpression and/or timeDefinition. When either definition change, the layer updates itself by querying features back from the server. Once the features are fetched to the client, their "visibility" on the map is based on the time and spatial extents of the map. So for example, for a time animation, you can request all features from server, then adjust time extent on Map to only show some of them.

The selection mode - MODE_SELECTION - only selected features are available on the client side. Usually used in combination with an underlying map service showing the features that can be selected.

The default value is MODE_ON_DEMAND.

This property can be used as the source for data binding.


Implementation
    public function get mode():String
    public function set mode(value:String):void
onDemandCacheSizeproperty 
onDemandCacheSize:uint

When the query mode is MODE_ON_DEMAND and there are more than this number of features loaded, features that are not selected and are not in the current extent are removed in FIFO order (first in, first out). If this value is 0, features in the current extent are also removed.

The default value is 1000 features.

This property can be used as the source for data binding.


Implementation
    public function get onDemandCacheSize():uint
    public function set onDemandCacheSize(value:uint):void
outFieldsproperty 
outFields:Array

Since : ArcGIS API for Flex 2.0

Attribute fields to include in the FeatureSet. Fields must exist in the layer. You must list the actual field names rather than the alias names. Returned fields are also the actual field names. However, you are able to use the alias names when you display the results.

For optimal performance, limit the output fields to only those you expect to use.

Each query must have access to the Shape and Objectid fields for a layer, but your list of fields does not need to include these two fields.

To return all fields, specify the wildcard "*" as the value of this parameter. In this case, the query results include all the fields.

Note that with ArcGIS Server 10.0 the wildcard no longer implicitly implies returnGeometry=true.

This property can be used as the source for data binding.


Implementation
    public function get outFields():Array
    public function set outFields(value:Array):void

Example
To ask for specific fields:
     myFeatureLayer.outFields = ["CITY_NAME","AGE_UNDER5","AGE_5_17","AGE_18_64","AGE_65_UP"];
To request all fields, use the star wildcard (this implies returnGeometry=true and setting returnGeometry to false will have no effect):
     myFeatureLayer.outFields = ["*"];
proxyURLproperty 
proxyURL:String

The URL to proxy the request through.

This property can be used as the source for data binding.


Implementation
    public function get proxyURL():String
    public function set proxyURL(value:String):void
requestTimeoutproperty 
requestTimeout:int

The request timeout in seconds. A value less than or equal to zero prevents request timeout.

The default value is -1.

This property can be used as the source for data binding.


Implementation
    public function get requestTimeout():int
    public function set requestTimeout(value:int):void
returnMproperty 
returnM:Boolean

Since : ArcGIS API 3.0 for Flex

If true, M values will be included in the geometry if the features have M values. Requires ArcGIS 10.1 or later (and data with M values).

The default value is false.

This property can be used as the source for data binding.


Implementation
    public function get returnM():Boolean
    public function set returnM(value:Boolean):void
returnZproperty 
returnZ:Boolean

Since : ArcGIS API 3.0 for Flex

If true, Z values will be included in the geometry if the features have Z values. Requires ArcGIS 10.1 or later (and data with Z values).

The default value is false.

This property can be used as the source for data binding.


Implementation
    public function get returnZ():Boolean
    public function set returnZ(value:Boolean):void
selectedFeaturesproperty 
selectedFeatures:Array  [read-only]

The features in the current selection of this feature layer.

This property can be used as the source for data binding.


Implementation
    public function get selectedFeatures():Array

See also

selectionColorproperty 
selectionColor:Number

Selection color to highlight the currently selected features. Set to NaN to turn off the highlight.

Note that this is not used for the feature selected by infoWindowRenderer.

The default value is 0xFFFF00 (yellow).

This property can be used as the source for data binding.


Implementation
    public function get selectionColor():Number
    public function set selectionColor(value:Number):void

See also

selectionSymbolproperty 
selectionSymbol:Symbol

Since : ArcGIS API 3.1 for Flex

Selection symbol used to render the currently selected features. If no symbol is specified, features are drawn using the layer's renderer. Make sure the symbol type is appropriate for the geometry type of the layer.

This property can be used as the source for data binding.


Implementation
    public function get selectionSymbol():Symbol
    public function set selectionSymbol(value:Symbol):void

See also

sourceproperty 
source:ILayerSource

The dynamic layer source. Required when the url is "http://<mapservice-url>/dynamicLayer".

This property can be used as the source for data binding.


Implementation
    public function get source():ILayerSource
    public function set source(value:ILayerSource):void
tableDetailsproperty 
tableDetails:TableDetails  [read-only]

Detailed information about a table in a map or feature service.

This property can be used as the source for data binding.


Implementation
    public function get tableDetails():TableDetails
timeDefinitionproperty 
timeDefinition:TimeExtent

Defines the time extent of features loaded in snapshot mode.

This property can be used as the source for data binding.


Implementation
    public function get timeDefinition():TimeExtent
    public function set timeDefinition(value:TimeExtent):void
timeOffsetproperty 
timeOffset:Number

The time offset for the layer.

This property can be used as the source for data binding.


Implementation
    public function get timeOffset():Number
    public function set timeOffset(value:Number):void
timeOffsetUnitsproperty 
timeOffsetUnits:String

The units of the timeOffset.

This property can be used as the source for data binding.


Implementation
    public function get timeOffsetUnits():String
    public function set timeOffsetUnits(value:String):void

See also

tokenproperty 
token:String

Token for accessing a secure ArcGIS service.

This property can be used as the source for data binding.


Implementation
    public function get token():String
    public function set token(value:String):void
trackIdFieldproperty 
trackIdField:String

The field that contains the trackId.

This property can be used as the source for data binding.


Implementation
    public function get trackIdField():String
    public function set trackIdField(value:String):void
urlproperty 
url:String

URL to the ArcGIS Server REST resource that represents a feature layer.

This property can be used as the source for data binding.


Implementation
    public function get url():String
    public function set url(value:String):void
useAMFproperty 
useAMF:Boolean

Since : ArcGIS API for Flex 2.0

Use AMF when loading features and for queryFeatures(), queryRelatedFeatures() and selectFeatures(). Requires the server to be ArcGIS Server 10.0 or above, set to false if using earlier server versions. When useAMF is true, the requestTimeout property is ignored.

The default value is true if using ArcGIS Server 10.0 or above; false otherwise.

This property can be used as the source for data binding.


Implementation
    public function get useAMF():Boolean
    public function set useAMF(value:Boolean):void
useMapTimeproperty 
useMapTime:Boolean

Since : ArcGIS API for Flex 2.2

If true and the layer is time aware, the layer will be updated whenever the map's timeExtent changes.

The default value is true.

This property can be used as the source for data binding.


Implementation
    public function get useMapTime():Boolean
    public function set useMapTime(value:Boolean):void
userIdproperty 
userId:String

Since : ArcGIS API 3.0 for Flex

User associated with a secure ArcGIS service.

This property can be used as the source for data binding.


Implementation
    public function get userId():String
    public function set userId(value:String):void
Constructor Detail
FeatureLayer()Constructor
public function FeatureLayer(url:String = null, proxyURL:String = null, token:String = null)

Creates a new FeatureLayer object.

Parameters
url:String (default = null) — URL to the ArcGIS Server REST resource that represents a feature layer.
 
proxyURL:String (default = null) — The URL to proxy the request through.
 
token:String (default = null) — Token for accessing a secure ArcGIS service.
Method Detail
add()method
override public function add(graphic:Graphic):String

The add() method is not supported for FeatureLayer, use applyEdits() to add features to a FeatureLayer.

Parameters

graphic:Graphic

Returns
String
addAttachment()method 
public function addAttachment(objectId:Number, data:ByteArray, name:String, contentType:String = null, responder:IResponder = null):AsyncToken

Add attachment to a feature (using its ObjectID).

Parameters

objectId:Number — The ObjectID.
 
data:ByteArray — The byte array of the attachment.
 
name:String — The name of the attachment
 
contentType:String (default = null) — If not set, the name is checked for one of (avi, csv, doc, docx, f4v, flv, gif, htm, html, jpeg, jpg, mov, mpeg, mpg, pdf, png, ppt, pptx, swf, tif, txt, xls, xlsx, xml, zip), and if no match is found, the contentType is set to application/octet-stream.
 
responder:IResponder (default = null) — The responder to call on result or fault.

Returns
AsyncToken
applyEdits()method 
public function applyEdits(adds:Array, updates:Array, deletes:Array, rollbackOnFailure:Boolean = false, responder:IResponder = null):AsyncToken

Saves edits on the server. Only applicable for an editable layer that is part of a Feature Service. Make sure the FeatureLayer is loaded before you attempt applyEdits on it.

Parameters

adds:Array — Array of features to add to the layer in the feature service.
 
updates:Array — Array of features to modify. Must have valid objectId.
 
deletes:Array — Array of features to delete. Must have valid objectId.
 
rollbackOnFailure:Boolean (default = false) — If true, server will keep the edits only if all edits succeed.
 
responder:IResponder (default = null) — The responder to call on result or fault.

Returns
AsyncToken
clear()method 
override public function clear():void

clear() is not supported.

clearSelection()method 
public function clearSelection():void

Clears the current selection set.

deleteAttachments()method 
public function deleteAttachments(objectId:Number, attachmentIds:Array, rollbackOnFailure:Boolean = false, responder:IResponder = null):AsyncToken

Delete one or more attachments for a feature.

Parameters

objectId:Number — The ObjectID.
 
attachmentIds:Array — The array of attachment IDs.
 
rollbackOnFailure:Boolean (default = false) — If true, server will delete the attachments only if all deletes succeed.
 
responder:IResponder (default = null) — The responder to call on result or fault.

Returns
AsyncToken
getEditSummary()method 
public function getEditSummary(graphic:Graphic):String

Since : ArcGIS API 3.0 for Flex

Returns a localized summary of the last edit operation performed on the given feature, if available. For example:

  • Edited by Mike seconds ago
  • Edited by Mike a minute ago
  • Edited by Mike 15 minutes ago
  • Edited by Mike an hour ago
  • Edited by Mike 5 hours ago
  • Edited by Mike on Tuesday at 1:30 PM
  • Edited by Mike on 1/1/2012 at 9:00 PM
  • The word "Edited" will be replaced by "Created" if the author has disabled editorField attribute but enabled creatorField attribute. The user component and date-time component may or may not be available depending on your layer's edit tracking settings.

    An empty string will be returned if:

    Parameters

    graphic:Graphic

    Returns
    String

    See also

    isDeleteAllowed()method 
    public function isDeleteAllowed(graphic:Graphic):Boolean

    Since : ArcGIS API 3.0 for Flex

    Determines whether the specified graphic can be deleted by taking into account the ownership-based access control.

    Parameters

    graphic:Graphic

    Returns
    Boolean
    isUpdateAllowed()method 
    public function isUpdateAllowed(graphic:Graphic):Boolean

    Since : ArcGIS API 3.0 for Flex

    Determines whether the specified graphic can be updated by taking into account the ownership-based access control.

    Parameters

    graphic:Graphic

    Returns
    Boolean
    queryAttachmentInfos()method 
    public function queryAttachmentInfos(objectId:Number, responder:IResponder = null):AsyncToken

    Information about attachment(s) for a specific ObjectID. Used to find out if a feature has attachments.

    Parameters

    objectId:Number — The ObjectID.
     
    responder:IResponder (default = null) — The responder to call on result or fault.

    Returns
    AsyncToken
    queryCount()method 
    public function queryCount(parameters:Query, responder:IResponder = null):AsyncToken

    Gets the count of features that satisfy the input query.

    Parameters

    parameters:Query — The selection query.
     
    responder:IResponder (default = null) — The responder to call on result or fault.

    Returns
    AsyncToken
    queryFeatures()method 
    public function queryFeatures(parameters:Query, responder:IResponder = null):AsyncToken

    Query features from the feature layer. Current layer properties (layer definition, time definition) will be honored and passed into the query. When specifying the fields to be returned, make sure to set the outFields property on the FeatureLayer.

    Parameters

    parameters:Query — The selection query.
     
    responder:IResponder (default = null) — The responder to call on result or fault.

    Returns
    AsyncToken
    queryIds()method 
    public function queryIds(parameters:Query, responder:IResponder = null):AsyncToken

    Query for object IDs. Note that there is no limit on the number of object IDs that can be returned from the server.

    Parameters

    parameters:Query — The selection query.
     
    responder:IResponder (default = null) — The responder to call on result or fault.

    Returns
    AsyncToken
    queryRelatedFeatures()method 
    public function queryRelatedFeatures(parameters:RelationshipQuery, responder:IResponder = null):AsyncToken

    Query related features from this feature layer.

    Parameters

    parameters:RelationshipQuery — The selection query.
     
    responder:IResponder (default = null) — The responder to call on result or fault.

    Returns
    AsyncToken
    remove()method 
    override public function remove(graphic:Graphic):void

    remove() is not supported. Use applyEdits().

    Parameters

    graphic:Graphic

    selectFeatures()method 
    public function selectFeatures(query:Query, selectionMethod:String = new, responder:IResponder = null):AsyncToken

    Sets or modifies the current set of selected features. You can create a new selection (the default selection mode), as well as adding to or removing from the current selection. See the SELECTION_* constants for more details. When specifying the fields to be returned, make sure to set the outFields property on the FeatureLayer.

    Parameters

    query:Query — The selection query.
     
    selectionMethod:String (default = new) — The selection method (SELECTION_NEW, SELECTION_ADD or SELECTION_SUBTRACT).
     
    responder:IResponder (default = null) — The responder to call on result or fault.

    Returns
    AsyncToken
    Event Detail
    addAttachmentComplete Event
    Event Object Type: com.esri.ags.events.AttachmentEvent
    AttachmentEvent.type property = com.esri.ags.events.AttachmentEvent.ADD_ATTACHMENT_COMPLETE

    Dispatched when an addAttachment operation successfully completes.

    Defines the value of the type property of the event object for an addAttachmentComplete event.
    deleteAttachmentsComplete Event  
    Event Object Type: com.esri.ags.events.AttachmentEvent
    AttachmentEvent.type property = com.esri.ags.events.AttachmentEvent.DELETE_ATTACHMENTS_COMPLETE

    Dispatched when a deleteAttachments operation successfully completes.

    Defines the value of the type property of the event object for a deleteAttachmentsComplete event.
    editsComplete Event  
    Event Object Type: com.esri.ags.events.FeatureLayerEvent
    FeatureLayerEvent.type property = com.esri.ags.events.FeatureLayerEvent.EDITS_COMPLETE

    Dispatched when an applyEdits operation successfully completes.

    Defines the value of the type property of the event object for an editsComplete event.
    editsStarting Event  
    Event Object Type: com.esri.ags.events.FeatureLayerEvent
    FeatureLayerEvent.type property = com.esri.ags.events.FeatureLayerEvent.EDITS_STARTING

    Dispatched when applyEdits is called, but before the edits request is sent to the server. This event is cancelable by calling event.preventDefault() which will stop the request from being sent.

    Defines the value of the type property of the event object for an editsStarting event.
    fault Event  
    Event Object Type: mx.rpc.events.FaultEvent
    FaultEvent.type property = mx.rpc.events.FaultEvent.FAULT

    Dispatched when a FeatureLayer operation fails.

    queryAttachmentInfosComplete Event  
    Event Object Type: com.esri.ags.events.AttachmentEvent
    AttachmentEvent.type property = com.esri.ags.events.AttachmentEvent.QUERY_ATTACHMENT_INFOS_COMPLETE

    Dispatched when a queryAttachmentInfos operation successfully completes.

    Defines the value of the type property of the event object for a queryAttachmentInfosComplete event.
    queryCountComplete Event  
    Event Object Type: com.esri.ags.events.FeatureLayerEvent
    FeatureLayerEvent.type property = com.esri.ags.events.FeatureLayerEvent.QUERY_COUNT_COMPLETE

    Dispatched when a queryCount operation successfully completes.

    Defines the value of the type property of the event object for a queryCountComplete event.
    queryFeaturesComplete Event  
    Event Object Type: com.esri.ags.events.FeatureLayerEvent
    FeatureLayerEvent.type property = com.esri.ags.events.FeatureLayerEvent.QUERY_FEATURES_COMPLETE

    Dispatched when a queryFeatures operation successfully completes.

    Defines the value of the type property of the event object for a queryFeaturesComplete event.
    queryIdsComplete Event  
    Event Object Type: com.esri.ags.events.FeatureLayerEvent
    FeatureLayerEvent.type property = com.esri.ags.events.FeatureLayerEvent.QUERY_IDS_COMPLETE

    Dispatched when a queryIds operation successfully completes.

    Defines the value of the type property of the event object for a queryIdsComplete event.
    queryLimitExceeded Event  
    Event Object Type: com.esri.ags.events.FeatureLayerEvent
    FeatureLayerEvent.type property = com.esri.ags.events.FeatureLayerEvent.QUERY_LIMIT_EXCEEDED

    Since : ArcGIS API 3.1 for Flex

    Dispatched when the FeatureLayer could not draw all the features due to a maxRecordCount limitation on a query operation. Requires ArcGIS 10.1 or later.

    Defines the value of the type property of the event object for a queryLimitExceeded event.
    queryRelatedFeaturesComplete Event  
    Event Object Type: com.esri.ags.events.FeatureLayerEvent
    FeatureLayerEvent.type property = com.esri.ags.events.FeatureLayerEvent.QUERY_RELATED_FEATURES_COMPLETE

    Dispatched when a queryRelatedFeatures operation successfully completes.

    Defines the value of the type property of the event object for a queryRelatedFeaturesComplete event.
    selectionClear Event  
    Event Object Type: com.esri.ags.events.FeatureLayerEvent
    FeatureLayerEvent.type property = com.esri.ags.events.FeatureLayerEvent.SELECTION_CLEAR

    Dispatched when a clearSelection operation successfully completes.

    Defines the value of the type property of the event object for a selectionClear event.
    selectionComplete Event  
    Event Object Type: com.esri.ags.events.FeatureLayerEvent
    FeatureLayerEvent.type property = com.esri.ags.events.FeatureLayerEvent.SELECTION_COMPLETE

    Dispatched when a selectFeatures operation successfully completes.

    Defines the value of the type property of the event object for a selectionComplete event.
    Constant Detail
    MODE_ON_DEMANDConstant
    public static const MODE_ON_DEMAND:String = onDemand

    Features will be retrieved as needed, when extent, time and layer definition changes..

    MODE_SELECTIONConstant 
    public static const MODE_SELECTION:String = selection

    Only selected features will be retrieved from the server and be stored in memory on the client.

    MODE_SNAPSHOTConstant 
    public static const MODE_SNAPSHOT:String = snapshot

    All features will be retrieved from server and stored in memory on the client.

    SELECTION_ADDConstant 
    public static const SELECTION_ADD:String = add

    Adds features to current set of selected features.

    SELECTION_NEWConstant 
    public static const SELECTION_NEW:String = new

    Creates a new set of selected features.

    SELECTION_SUBTRACTConstant 
    public static const SELECTION_SUBTRACT:String = subtract

    Removes features from the current set of selected features.