Packagecom.esri.ags.symbols
Classpublic class CompositeSymbol
InheritanceCompositeSymbol Inheritance Symbol Inheritance flash.events.EventDispatcher

Used to draw multiple symbols on a single graphic. The symbols can be a combination of point, line and fill symbols. For example, on polyline and polygon features a SimpleMarkerSymbol can be used for each node. Uses the ArrayCollection of the symbol objects to draw the respective symbols.

Note: CompositeSymbol do not support swatches, and thus cannot be used with the Editor component.

Note: as of version 1.1, you can create empty composite symbols.

Default MXML Propertysymbols

View the examples

See also

Live sample - star inside a circle


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

Used to draw multiple symbols on point, line or polygon features in a GraphicsLayer. This property lets you use either an Array, an ArrayCollection, or a single Symbol. If you set the symbols property to an Array, it will be converted to an ArrayCollection. If you set the property to an ArrayCollection, it will be used directly. If you set the property to a single Symbol, it will be wrapped in a new ArrayCollection.

The default value is an empty ArrayCollection.

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


Implementation
    public function get symbols():Object
    public function set symbols(value:Object):void

See also

Constructor Detail
CompositeSymbol()Constructor
public function CompositeSymbol(symbols:Object = null)

Creates a new CompositeSymbol.

Parameters
symbols:Object (default = null) — The symbols that make up the composite symbol.
Examples
MXML usage of CompositeSymbol:
 <esri:CompositeSymbol>
     <esri:SimpleMarkerSymbol style="circle" color="0x000000" size="20"/>
     <esri:SimpleMarkerSymbol style="triangle" color="0xFFFF00" size="20"/>
     <esri:SimpleMarkerSymbol style="triangle" color="0xFFFF00" size="20" angle="180"/>
 </esri:CompositeSymbol>
MXML usage of CompositeSymbol:
 <esri:CompositeSymbol>
     <esri:SimpleLineSymbol style="solid" alpha="1" color="0x0008F13"/>
     <esri:SimpleMarkerSymbol style="square" size="8" color="0x0008F13"/>
 </esri:CompositeSymbol>