Packagecom.esri.bacore.thematicmapping
Classpublic class TMLayer
InheritanceTMLayer Inheritance com.esri.ags.layers.GraphicsLayer
Subclasses ThematicMappingLayer, ThematicMappingLayer

The TMLayer class provides the base functionality for thematic layers.

Default MXML PropertygraphicProvider



Public Properties
 PropertyDefined By
  additionalFields : ArrayCollection
[read-only] Additional fields of the thematic layer requested in every query.
TMLayer
  analysisExtent : Geometry
Spatial/geographic extent on which to perform the query.
TMLayer
  attributesProvider : TMAttributesProvider
[read-only] Provider of thematic mapping attributes.
TMLayer
  autoUpdate : Boolean
The mode of applying updates to thematic layer.
TMLayer
  bestLayer : IGeographyLayerInfo
[read-only] Geography layer which is best to show for the current map extent.
TMLayer
  borderSymbol : SimpleLineSymbol
The symbol to draw borders around features.
TMLayer
  canUpdateVisualState : Boolean
[read-only] Returns true if the visual state of this layer can be modified.
TMLayer
  colorRamp : ColorRamp
Color Ramp to thematically shade this layer with.
TMLayer
  geographyLayer : IGeographyLayerInfo
[read-only] A geography layer whose features are currently shown in this layer.
TMLayer
  geographyLevelAliasName : String
[read-only] Alias name of the geography level whose layer is currently shown in this layer.
TMLayer
  geographyLevelName : String
Name of the geography level whose layer is currently shown in this layer.
TMLayer
  geographyLevels : GeographyLevels
[read-only] Available geography levels.
TMLayer
  geographyLevelsFilter : Function
[write-only] Filter for geography levels available in thematic layer.
TMLayer
  intersectAnalysisExtentWithMapExtent : Boolean
Defines how to compose an extent to perform the query when analysis extent is specified.
TMLayer
  isReady : Boolean
[read-only] Is true if this layer is ready for show on map.
TMLayer
  isUpdating : Boolean
[read-only] Is true if this layer is now updating.
TMLayer
  mapExtentDrift : Number
Fraction of linear drift of map extent which is ignored in the auto-update mode.
TMLayer
  queryTaskProvider : TMQueryTaskProvider
[read-only] Provider of thematic mapping query task.
TMLayer
  showMissingValuesAsZeroes : Boolean
Specifies how to convert missing values of attributes with attributes provider: to zeros (true) or to NaN (false).
TMLayer
  spatialRelationship : SpatialRelEnum
The spatial selection method used for selection geography layer features in query task.
TMLayer
  symbolizationProvider : TMSymbolizationProvider
Symbolization provider associated with this thematic layer.
TMLayer
  tmValueField : String
Name of the calculated field which will contain a value to render the thematic layer by.
TMLayer
  valueCalculator : ValueCalculator
Calculator of value to thematically shade this layer by.
TMLayer
  where : String
Query WHERE clause.
TMLayer
  zIndex : int
The base z-index of features of this layer.
TMLayer
Public Methods
 MethodDefined By
  
Creates a new instance of the TMLayer class.
TMLayer
  
applyUpdates(forceUpdates:Boolean = false):Boolean
Applies updates collected on this layer.
TMLayer
  
createDescription(graphic:Graphic, descriptionStyle:ValueDescriptionStyle):Object
[static] Creates fields describing value calculation properties for the given graphic feature of a thematic layer.
TMLayer
  
createDescriptionFields(graphic:Graphic, descriptionStyle:ValueDescriptionStyle):Array
[static] Creates an array of fields describing value calculation properties for the given graphic feature of a thematic layer.
TMLayer
  
executeQueryTask(layerInfo:IGeographyLayerInfo, query:Query, responder:IResponder):Boolean
Executes a query for the given geography layer.
TMLayer
  
getLegendInfos(responder:IResponder = null):AsyncToken
[override] Gets legend infos.
TMLayer
  
initializeQueryTask(responder:IResponder):Boolean
Initializes the query task associated with this layer.
TMLayer
  
isGeographyLevelAvailable(name:String):Boolean
Tests the geography level to be available for the current map scale.
TMLayer
  
prepareQuery():Query
Prepares base query parameters.
TMLayer
  
Suspends auto updates for this layer.
TMLayer
  
updateTooltips():Boolean
Immediately updates graphic tooltips if this is possible.
TMLayer
  
Immediately updates the visual state of this layer if this is possible.
TMLayer
Protected Methods
 MethodDefined By
  
Creates the default symbolization provider to be used together with this thematic layer.
TMLayer
Events
 Event Summary Defined By
  The extentChange event is dispatched when the current map extent is changed.TMLayer
  The fault event is dispatched when an asynchronous execution of query task fails.TMLayer
  The propertyChange event is dispatched when a property of thematic layer is changed.TMLayer
  The taskProgress event is dispatched when a thematic layer update state is changed.TMLayer
  The tmLayerAvailable event is dispatched when the thematic layer availability is changed.TMLayer
  The tmLayerChanged event is dispatched when the thematic layer updates are completed.TMLayer
  The tmRenderer event is dispatched while updating a symbol for rendering a graphic.TMLayer
  The tmValueUpdated event is dispatched when the thematic value of a graphic is updated.TMLayer
Property Detail
additionalFieldsproperty
additionalFields:ArrayCollection  [read-only]

Additional fields of the thematic layer requested in every query.


Implementation
    public function get additionalFields():ArrayCollection
analysisExtentproperty 
analysisExtent:Geometry

Spatial/geographic extent on which to perform the query. If this extent is missing, the current map extent is used as the analysis extent.

The default value is null.

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


Implementation
    public function get analysisExtent():Geometry
    public function set analysisExtent(value:Geometry):void
attributesProviderproperty 
attributesProvider:TMAttributesProvider  [read-only]

Provider of thematic mapping attributes. The provider is associated with the current geography layer. If the geography layer is missing, the provider will be null.


Implementation
    public function get attributesProvider():TMAttributesProvider
autoUpdateproperty 
autoUpdate:Boolean

The mode of applying updates to thematic layer.

In auto-update mode (autoUpdate is true), any change in layer extent or properties affecting on layer symbolization and rendering are immediately applied. In manual-update mode (autoUpdate is false), updates are applied on applyUpdates call.

To temporary turn off auto-updating in auto-update mode, call the suspendUpdates method. Updates will be suspended until the first applyUpdates call.

The default value is true.

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


Implementation
    public function get autoUpdate():Boolean
    public function set autoUpdate(value:Boolean):void
bestLayerproperty 
bestLayer:IGeographyLayerInfo  [read-only]

Geography layer which is best to show for the current map extent.

This property value is usually the same as the value of the geographyLayer property except the case when the thematic layer is not shown on the map. In this case, the geographyLayer property value can be out-of-date and the bestLayer property value returns an actual layer to be shown when the thematic layer will be visible.


Implementation
    public function get bestLayer():IGeographyLayerInfo
borderSymbolproperty 
borderSymbol:SimpleLineSymbol

The symbol to draw borders around features.

The default value is null.

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


Implementation
    public function get borderSymbol():SimpleLineSymbol
    public function set borderSymbol(value:SimpleLineSymbol):void
canUpdateVisualStateproperty 
canUpdateVisualState:Boolean  [read-only]

Returns true if the visual state of this layer can be modified.


Implementation
    public function get canUpdateVisualState():Boolean
colorRampproperty 
colorRamp:ColorRamp

Color Ramp to thematically shade this layer with.

The default value is an instance of the TMColorRamp type with "yellow to red" gradient.

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


Implementation
    public function get colorRamp():ColorRamp
    public function set colorRamp(value:ColorRamp):void

See also

geographyLayerproperty 
geographyLayer:IGeographyLayerInfo  [read-only]

A geography layer whose features are currently shown in this layer.


Implementation
    public function get geographyLayer():IGeographyLayerInfo
geographyLevelAliasNameproperty 
geographyLevelAliasName:String  [read-only]

Alias name of the geography level whose layer is currently shown in this layer.


Implementation
    public function get geographyLevelAliasName():String
geographyLevelNameproperty 
geographyLevelName:String

Name of the geography level whose layer is currently shown in this layer.


Implementation
    public function get geographyLevelName():String
    public function set geographyLevelName(value:String):void
geographyLevelsproperty 
geographyLevels:GeographyLevels  [read-only]

Available geography levels. This collection is populated while initialization.


Implementation
    public function get geographyLevels():GeographyLevels
geographyLevelsFilterproperty 
geographyLevelsFilter:Function  [write-only]

Since : Community Analyst API for Flex 2.2.

Filter for geography levels available in thematic layer.

Using this function you can customize a collection of available geography levels when the thematic query task associated with this layer is initialized. The signature of this function is the following:

geographyLevelsFilter(levels:Array):Array

The input parameter contains an array of GeographyLevelInfo items received while initialization the query task. The result array should contain geography levels, which will be associated with the geographyLevels property of the thematic layer.


Implementation
    public function set geographyLevelsFilter(value:Function):void

See also

intersectAnalysisExtentWithMapExtentproperty 
intersectAnalysisExtentWithMapExtent:Boolean

Defines how to compose an extent to perform the query when analysis extent is specified.

If this value is false and the analysis extent is specified, this extent is always used to perform query on. If this value is true and the analysis extent is specified, an intersection of the analysis extent envolope with the current map extent is used to perform the query on.

The default value is false.

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


Implementation
    public function get intersectAnalysisExtentWithMapExtent():Boolean
    public function set intersectAnalysisExtentWithMapExtent(value:Boolean):void
isReadyproperty 
isReady:Boolean  [read-only]

Is true if this layer is ready for show on map.


Implementation
    public function get isReady():Boolean
isUpdatingproperty 
isUpdating:Boolean  [read-only]

Since : Community Analyst API for Flex 2.2.

Is true if this layer is now updating.


Implementation
    public function get isUpdating():Boolean
mapExtentDriftproperty 
mapExtentDrift:Number

Fraction of linear drift of map extent which is ignored in the auto-update mode.

The default value is 0.01.


Implementation
    public function get mapExtentDrift():Number
    public function set mapExtentDrift(value:Number):void
queryTaskProviderproperty 
queryTaskProvider:TMQueryTaskProvider  [read-only]

Provider of thematic mapping query task.


Implementation
    public function get queryTaskProvider():TMQueryTaskProvider
showMissingValuesAsZeroesproperty 
showMissingValuesAsZeroes:Boolean

Specifies how to convert missing values of attributes with attributes provider: to zeros (true) or to NaN (false).

The default value is false.


Implementation
    public function get showMissingValuesAsZeroes():Boolean
    public function set showMissingValuesAsZeroes(value:Boolean):void
spatialRelationshipproperty 
spatialRelationship:SpatialRelEnum

The spatial selection method used for selection geography layer features in query task.

The default value is SpatialRelEnum.INTERSECTS.

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


Implementation
    public function get spatialRelationship():SpatialRelEnum
    public function set spatialRelationship(value:SpatialRelEnum):void
symbolizationProviderproperty 
symbolizationProvider:TMSymbolizationProvider

Symbolization provider associated with this thematic layer.

The default value is an instance returned by the createDefaultSymbolizationProvider method.

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


Implementation
    public function get symbolizationProvider():TMSymbolizationProvider
    public function set symbolizationProvider(value:TMSymbolizationProvider):void
tmValueFieldproperty 
tmValueField:String

Name of the calculated field which will contain a value to render the thematic layer by.

The default value is "$TMValue".


Implementation
    public function get tmValueField():String
    public function set tmValueField(value:String):void
valueCalculatorproperty 
valueCalculator:ValueCalculator

Calculator of value to thematically shade this layer by.

The default value is null.

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


Implementation
    public function get valueCalculator():ValueCalculator
    public function set valueCalculator(value:ValueCalculator):void
whereproperty 
where:String

Query WHERE clause.

The default value is null.

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


Implementation
    public function get where():String
    public function set where(value:String):void
zIndexproperty 
zIndex:int

The base z-index of features of this layer.

This property value is assigned as z-index to all graphic features of layer when the features are rendered. If a symbol of feature is updated within "tmRenderer" event, its updating priority is added to the base z-index. Therefore, features with a positive priority will have greater z-index that others and they will be drawn over other graphic features.

If this property value is negative, z-index of graphic features isn't changed while rendering.

The default value is 0.

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


Implementation
    public function get zIndex():int
    public function set zIndex(value:int):void
Constructor Detail
TMLayer()Constructor
public function TMLayer()

Creates a new instance of the TMLayer class.

Method Detail
applyUpdates()method
public function applyUpdates(forceUpdates:Boolean = false):Boolean

Applies updates collected on this layer.

In auto-update mode, the updates collected from the last suspendUpdates call are applied. In manual-update mode, the updates collected from the last applyUpdates call are applied.

Since Community Analyst API 2.2, the optional forceUpdates parameter is added. It allows user to force the full update of the thematic layer by demand.

Parameters

forceUpdates:Boolean (default = false) — True value means that the full update of the thematic layer will be forced.

Returns
Boolean — True if some updates are actually applied, false otherwise.
createDefaultSymbolizationProvider()method 
protected function createDefaultSymbolizationProvider():TMSymbolizationProvider

Creates the default symbolization provider to be used together with this thematic layer.

The default symbolization provider is associated with a thematic layer if a user doesn't associate its own symbolization provider.

Returns
TMSymbolizationProvider — A new instance of the TMSymbolizationProvider class.
createDescription()method 
public static function createDescription(graphic:Graphic, descriptionStyle:ValueDescriptionStyle):Object

Creates fields describing value calculation properties for the given graphic feature of a thematic layer.

Parameters

graphic:Graphic — A graphic to create description fields for.
 
descriptionStyle:ValueDescriptionStyle — Value description style.

Returns
Object — A new object with description fields.
createDescriptionFields()method 
public static function createDescriptionFields(graphic:Graphic, descriptionStyle:ValueDescriptionStyle):Array

Creates an array of fields describing value calculation properties for the given graphic feature of a thematic layer.

Parameters

graphic:Graphic — A graphic to create description fields for.
 
descriptionStyle:ValueDescriptionStyle — Value description style.

Returns
Array — An array of feature description fields containing KeyValuePair items.

See also

executeQueryTask()method 
public function executeQueryTask(layerInfo:IGeographyLayerInfo, query:Query, responder:IResponder):Boolean

Executes a query for the given geography layer.

The responder.fault method receives a parameter of the FaultEvent type and responder.result method receives a parameter of the BATaskCompletedEvent type whose result property contains the result of QueryTaskOutput type.

Parameters

layerInfo:IGeographyLayerInfo — A geography layer to execute query on.
 
query:Query — A query to execute.
 
responder:IResponder — A responder to handle query results.

Returns
Boolean — True if the executing has started.

See also

getLegendInfos()method 
override public function getLegendInfos(responder:IResponder = null):AsyncToken

Gets legend infos.

Parameters

responder:IResponder (default = null) — The responder to call on result or fault. The result function will receive an Array of LayerLegendInfo instances.

Returns
AsyncToken — The request token.
initializeQueryTask()method 
public function initializeQueryTask(responder:IResponder):Boolean

Initializes the query task associated with this layer.

The responder.fault method receives a parameter of the FaultEvent type and responder.result method receives a parameter of the BATaskCompletedEvent type whose result property contains the array of GeographyLevelInfo items.

If more than one query task is specified for this layer, all of them are initialized and their result lists are merged into one list which is passed to the responder.result method.

Since Community Analyst API for Flex 2.2, this method starts initialization every time it is invoked and always returns the true value. A possibility of customization of the list of available geography levels is also added with the geographyLevelsFilter property.

Parameters

responder:IResponder — A responder to handle initialization results.

Returns
Boolean — True if the initializing has started.

See also

isGeographyLevelAvailable()method 
public function isGeographyLevelAvailable(name:String):Boolean

Tests the geography level to be available for the current map scale.

Parameters

name:String — Geography level name.

Returns
Boolean — True if the geography level is available.
prepareQuery()method 
public function prepareQuery():Query

Prepares base query parameters.

This method populates the spatialRelationship, geometry, and outSpatialReference parameters of a new query with currently selected values for this thematic layer.

Returns
Query — a new query.
suspendUpdates()method 
public function suspendUpdates():void

Suspends auto updates for this layer.

updateTooltips()method 
public function updateTooltips():Boolean

Immediately updates graphic tooltips if this is possible.

This method ignores the suspend updates mode and tries to immediately update tooltips of graphics. If the visual state of this layer cannot be modified, the request for updating tooltips is ignored.

Returns
Boolean — True value if the tooltips were immediately updated.
updateVisualState()method 
public function updateVisualState():Boolean

Immediately updates the visual state of this layer if this is possible.

This method ignores the suspend updates mode and tries to immediately update the renderer of layer. If the visual state of this layer cannot be modified, the request is ignored.

Returns
Boolean — True value if the renderer was immediately updated.
Event Detail
extentChange Event
Event Object Type: com.esri.ags.events.ExtentEvent
ExtentEvent.type property = com.esri.ags.events.ExtentEvent.EXTENT_CHANGE

The extentChange event is dispatched when the current map extent is changed.

fault Event  
Event Object Type: mx.rpc.events.FaultEvent
FaultEvent.type property = mx.rpc.events.FaultEvent.FAULT

The fault event is dispatched when an asynchronous execution of query task fails.

propertyChange Event  
Event Object Type: mx.events.PropertyChangeEvent
PropertyChangeEvent.type property = mx.events.PropertyChangeEvent.PROPERTY_CHANGE

The propertyChange event is dispatched when a property of thematic layer is changed.

taskProgress Event  
Event Object Type: com.esri.bacore.thematicmapping.ProgressEvent
ProgressEvent.type property = com.esri.bacore.thematicmapping.ProgressEvent.PROGRESS

The taskProgress event is dispatched when a thematic layer update state is changed.

This event is dispatched with following values of the progress property:

ValueDescription
0Start update thematic layer.
25Start asynchronous execution of query task.
50Start update render.
100Complete update thematic layer or failed to execute query task.

The ProgressEvent.PROGRESS constant defines the value of the type property of the event object for a taskProgress event.

The properties of the event object have the following values:

PropertyValue
babblesfalse
cancelablefalse
currentTargetThe Object that defines the event listener that handles the event.
progressProgress value.
targetThe Object that dispatched the event; it is not always the Object listening for the event. Use the currentTarget property to always access the Object listening for the event.

tmLayerAvailable Event  
Event Object Type: com.esri.bacore.thematicmapping.TMLayerAvailableEvent
TMLayerAvailableEvent.type property = com.esri.bacore.thematicmapping.TMLayerAvailableEvent.TYPE

The tmLayerAvailable event is dispatched when the thematic layer availability is changed.

The TMLayerAvailableEvent.TYPE constant defines the value of the type property of the event object for a tmLayerAvailable event.

The properties of the event object have the following values:

PropertyValue
babblesfalse
cancelablefalse
currentTargetThe Object that defines the event listener that handles the event.
isAvailableIs layer available for the given scale.
mapThe map associated with the layer.
targetThe Object that dispatched the event; it is not always the Object listening for the event. Use the currentTarget property to always access the Object listening for the event.

tmLayerChanged Event  
Event Object Type: com.esri.bacore.thematicmapping.TMLayerChangedEvent
TMLayerChangedEvent.type property = com.esri.bacore.thematicmapping.TMLayerChangedEvent.CHANGED

The tmLayerChanged event is dispatched when the thematic layer updates are completed.

The TMLayerChangedEvent.CHANGED constant defines the value of the type property of the event object for a tmLayerChanged event.

The properties of the event object have the following values:

PropertyValue
attributesChangedWhether feature attributes are changed or not.
babblesfalse
cancelablefalse
classificationChangedWhether classification of features is changed or not.
currentTargetThe Object that defines the event listener that handles the event.
geometryChangedWhether collection of features is changed or not.
rendererChangedWhether coloring of features is changed or not.
symbolizationChangedWhether symbolization provider is changed or not.
targetThe Object that dispatched the event; it is not always the Object listening for the event. Use the currentTarget property to always access the Object listening for the event.
tmValueChangedWhether thematic mapping value is changed or not.

tmRenderer Event  
Event Object Type: com.esri.bacore.thematicmapping.TMRendererEvent
TMRendererEvent.type property = com.esri.bacore.thematicmapping.TMRendererEvent.RENDERER

The tmRenderer event is dispatched while updating a symbol for rendering a graphic.

tmValueUpdated Event  
Event Object Type: com.esri.bacore.thematicmapping.TMValueEvent
TMValueEvent.type property = com.esri.bacore.thematicmapping.TMValueEvent.UPDATED

The tmValueUpdated event is dispatched when the thematic value of a graphic is updated.

The TMValueEvent.UPDATED constant defines the value of the type property of the event object for a tmValueUpdated event.

The properties of the event object have the following values:

PropertyValue
babblesfalse
cancelablefalse
currentTargetThe Object that defines the event listener that handles the event.
errorOptional error object which is specified when thematic value calculation fails.
graphicGraphic whose thematic value was updated.
targetThe Object that dispatched the event; it is not always the Object listening for the event. Use the currentTarget property to always access the Object listening for the event.
valueStateThematic value updating state.