Packagecom.esri.ags.layers.supportClasses
Classpublic class LayerDataSource
InheritanceLayerDataSource Inheritance flash.events.EventDispatcher
Implements ILayerSource, IJSONSupport

Since : ArcGIS API 3.0 for Flex

The LayerDataSource class defines and provides information about a layer created on the fly from a data source.

Note: Requires ArcGIS 10.1 or later.

Default MXML PropertydataSource

See also

Live sample - FeatureLayer based on a dynamic layer
Live sample - Dynamic layer based upon a dynamic workspace


Public Properties
 PropertyDefined By
  dataSource : IDataSource
The data source used to create the dynamic data layer on the fly.
LayerDataSource
  fields : Array
Use fields to control field visibility.
LayerDataSource
Public Methods
 MethodDefined By
  
toJSON(key:String = null):Object
Convert this LayerDataSource to a JSON object.
LayerDataSource
Property Detail
dataSourceproperty
dataSource:IDataSource

The data source used to create the dynamic data layer on the fly.

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


Implementation
    public function get dataSource():IDataSource
    public function set dataSource(value:IDataSource):void
fieldsproperty 
fields:Array

Use fields to control field visibility. If this property is null, then all the fields will be visible. Array elements should be Fields with the "name", and optionally, "alias" properties set; all other properties are ignored. When explicitly setting the fields, make sure to request the geometry field such as "Shape" if you want the geometry returned in the request.

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


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

See also

Method Detail
toJSON()method
public function toJSON(key:String = null):Object

Convert this LayerDataSource to a JSON object. If you need a JSON formatted string, you can pass this LayerDataSource directly to JSONUtil.encode().

Parameters

key:String (default = null) — Unused but required for compatibility with JSON.stringify().

Returns
Object — JSON object

See also