Packagecom.esri.ags.symbols
Classpublic class Symbol
InheritanceSymbol Inheritance flash.events.EventDispatcher
Subclasses CellSymbol, CompositeSymbol, FillSymbol, FlareSymbol, InfoSymbol, LineSymbol, MarkerSymbol, SimpleClusterSymbol, TextSymbol

Base class for all symbols. To display points, polylines and polygons on the graphics layer, instead use the following:



Public Methods
 MethodDefined By
  
Creates a new Symbol.
Symbol
  
clear(sprite:Sprite):void
Clears the graphics that were drawn to the sprite object.
Symbol
  
createSwatch(width:Number = 50, height:Number = 50):UIComponent
Creates a swatch for a symbol which can be used in a legend.
Symbol
  
destroy(sprite:Sprite):void
Removes all the graphics that were drawn to the sprite object and resets its properties.
Symbol
  
draw(sprite:Sprite, geometry:Geometry, attributes:Object, map:Map):void
Draw the graphics on the sprite object.
Symbol
  
initialize(sprite:Sprite, geometry:Geometry, attributes:Object, map:Map):void
Initialize the sprite.
Symbol
Protected Methods
 MethodDefined By
  
Helper function to dispatch a change event.
Symbol
  
removeAllChildren(sprite:Sprite):void
Removes all children from the sprite object.
Symbol
  
toScreenX(map:Map, mapX:Number):Number
Converts the x-coordinate of map point to a screen point.
Symbol
  
toScreenY(map:Map, mapY:Number):Number
Converts the y-coordinate of map point to a screen point.
Symbol
Constructor Detail
Symbol()Constructor
public function Symbol()

Creates a new Symbol.

Method Detail
clear()method
public function clear(sprite:Sprite):void

Clears the graphics that were drawn to the sprite object.

Parameters

sprite:Sprite — The sprite to be cleared.

createSwatch()method 
public function createSwatch(width:Number = 50, height:Number = 50):UIComponent

Creates a swatch for a symbol which can be used in a legend. Swatches only work with symbols which are supported in the FeatureService, i.e., swatches are not supported for CompositeSymbol, InfoSymbol and TextSymbol.

Parameters

width:Number (default = 50) — Width of the symbol swatch in pixels.
 
height:Number (default = 50) — Height of the symbol swatch in pixels.

Returns
UIComponent — UIComponent
destroy()method 
public function destroy(sprite:Sprite):void

Removes all the graphics that were drawn to the sprite object and resets its properties.

Parameters

sprite:Sprite — The sprite to be destroyed.

dispatchEventChange()method 
protected function dispatchEventChange():void

Helper function to dispatch a change event. The change event causes the graphic to redraw.

draw()method 
public function draw(sprite:Sprite, geometry:Geometry, attributes:Object, map:Map):void

Draw the graphics on the sprite object.

Parameters

sprite:Sprite — The Sprite object on which the symbol is drawn.
 
geometry:Geometry — The Geometry of the associated graphic.
 
attributes:Object — The Attributes of the associated graphic.
 
map:Map — The Map to set the location of the sprite object.

initialize()method 
public function initialize(sprite:Sprite, geometry:Geometry, attributes:Object, map:Map):void

Initialize the sprite. This function is called once, when the symbol is assigned to a Graphic.

Parameters

sprite:Sprite — The Sprite object to be instalized.
 
geometry:Geometry — The Geometry of the associated graphic.
 
attributes:Object — The Attributes of the associated graphic.
 
map:Map — The Map to set the location of the sprite object.

removeAllChildren()method 
protected function removeAllChildren(sprite:Sprite):void

Removes all children from the sprite object.

Parameters

sprite:Sprite — The sprite object whose children have to be removed.

toScreenX()method 
protected function toScreenX(map:Map, mapX:Number):Number

Converts the x-coordinate of map point to a screen point.

Parameters

map:Map — The Map.
 
mapX:Number — The x-coordinate of the map point to convert.

Returns
Number — The x-coordinate in screen coordinates.
toScreenY()method 
protected function toScreenY(map:Map, mapY:Number):Number

Converts the y-coordinate of map point to a screen point.

Parameters

map:Map — The Map.
 
mapY:Number — The y-coordinate of the map point to convert.

Returns
Number — The y-coordinate in screen coordinates.