| Package | com.esri.ags.layers |
| Class | public class GraphicsLayer |
| Inheritance | GraphicsLayer Layer mx.core.UIComponent |
| Implements | ILegendSupport |
| Subclasses | FeatureLayer |
Note that GraphicsLayer, like all layers, extend UIComponent and thus include basic mouse events, for example: 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
| Property | Defined By | ||
|---|---|---|---|
| clusterer : IClusterer
The graphics clusterer. | GraphicsLayer | ||
| graphicProvider : Object
Set of graphics to be viewed. | GraphicsLayer | ||
| infoWindowRenderer : IFactory
The info renderer. | GraphicsLayer | ||
| initialExtent : Extent [override]
Initial extent of the layer. | GraphicsLayer | ||
![]() | isInScaleRange : Boolean [read-only]
Returns true if the current scale of the map is between the maximum and minimum scale of the layer [added in version 1.3]. | Layer | |
![]() | loaded : Boolean [read-only]
When the layer is loaded, the value becomes "true" and layer properties can be accessed. | Layer | |
![]() | loadFault : Fault [read-only]
A reference to the fault that is dispatched when the layer throws a loadError event. | Layer | |
![]() | map : Map [read-only]
A reference to the Map this layer is in. | Layer | |
![]() | maxScale : Number
The maximum scale of the layer [added in version 1.3]. | Layer | |
![]() | minScale : Number
The minimum scale of the layer [added in version 1.3]. | Layer | |
| numGraphics : int [read-only]
Gets the number of graphics in that layer. | GraphicsLayer | ||
| renderer : Renderer
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 | ||
| spatialReference : SpatialReference [override]
The spatial reference of the map layer. | GraphicsLayer | ||
| symbol : Symbol
The default symbol for the layer. | GraphicsLayer | ||
| units : String [override]
The units of the layer. | GraphicsLayer | ||
| Method | Defined By | ||
|---|---|---|---|
Creates a new GraphicsLayer. | GraphicsLayer | ||
Adds a graphic. | GraphicsLayer | ||
clear():void
Clears all graphics. | GraphicsLayer | ||
getLegendInfos(responder:IResponder = null):AsyncToken
Gets legend infos. | GraphicsLayer | ||
Moves a specific graphic to the top of the stack. | GraphicsLayer | ||
![]() | refresh():void
Causes the layer to redraw or reload its content. | Layer | |
Removes the specific graphic. | GraphicsLayer | ||
| Event | Summary | Defined By | ||
|---|---|---|---|---|
| Fires when a graphic is added to the GraphicsLayer. | GraphicsLayer | |||
| Fires when a graphic is removed from the GraphicsLayer. | GraphicsLayer | |||
| Fires when all graphics in the GraphicsLayer are cleared. | GraphicsLayer | |||
![]() | Fires if the value of isInScaleRange changes. | Layer | ||
![]() | Fires after layer properties for the layer are successfully populated. | Layer | ||
![]() | Fires if the layer is unable to load. | Layer | ||
![]() | Fires when the layer has finished updating its content. | Layer | ||
![]() | Fires when the layer begins to update its content. | Layer | ||
| clusterer | property |
clusterer:IClustererThe graphics clusterer.
This property can be used as the source for data binding.
public function get clusterer():IClusterer public function set clusterer(value:IClusterer):void| graphicProvider | property |
graphicProvider:Object
Set of graphics to be viewed.
This property lets you use either an Array, an ArrayCollection, or a single Graphic as graphic providers.
If you set the graphicProvider 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 Graphic, it will be wrapped in a new ArrayCollection.
As a consequence of the conversions, when you get the
graphicProvider property, it will always be
an ArrayCollection.
The default value is an empty ArrayCollection.
This property can be used as the source for data binding.
public function get graphicProvider():Object public function set graphicProvider(value:Object):voidSee also
| infoWindowRenderer | property |
infoWindowRenderer:IFactoryThe info renderer.
public function get infoWindowRenderer():IFactory public function set infoWindowRenderer(value:IFactory):voidSee also
| initialExtent | property |
initialExtent:Extent[override] Initial extent of the layer. Used by the map if it is the first layer in the map and map doesn't have an extent specified.
The default value is new Extent(-180, -90, 180, 90, new SpatialReference(4326)).
public function get initialExtent():Extent public function set initialExtent(value:Extent):void| numGraphics | property |
numGraphics:int [read-only] Gets the number of graphics in that layer.
This property can be used as the source for data binding.
public function get numGraphics():int| renderer | property |
renderer:RendererThe 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. This will be used when graphic does not have its own symbol.
This property can be used as the source for data binding.
public function get renderer():Renderer public function set renderer(value:Renderer):voidSee also
| spatialReference | property |
spatialReference:SpatialReference[override] The spatial reference of the map layer.
The default value is new SpatialReference(4326).
public function get spatialReference():SpatialReference public function set spatialReference(value:SpatialReference):void| symbol | property |
symbol:SymbolThe default symbol for the layer. This symbol will be used when graphic does not define one and a symbolFunction is not defined. Any individual graphic with a symbol assigned, will use that symbol instead of anything specified on its layer.
This property can be used as the source for data binding.
public function get symbol():Symbol public function set symbol(value:Symbol):void| units | property |
units:String[override] The units of the layer.
The default value is DECIMAL_DEGRESS.
public function get units():String public function set units(value:String):void| GraphicsLayer | () | Constructor |
public function GraphicsLayer()Creates a new GraphicsLayer.
| add | () | method |
public function add(graphic:Graphic):StringAdds a graphic. If an ID was not defined, a unique name will be created and assigned to the graphic. The unique name is created using NameUtil.createUniqueName, which will combine the unqualified class name with an incrementing counter to create something like "Graphic67".
Parameters
graphic:Graphic — The graphic to add.
|
String — The graphic id.
|
See also
| clear | () | method |
public function clear():voidClears all graphics.
See also
| getLegendInfos | () | method |
public function getLegendInfos(responder:IResponder = null):AsyncTokenGets legend infos.
Parameters
responder:IResponder (default = null) — The responder to call on result or fault.
The result function will be given an Array of LayerLegendInfo instances.
|
AsyncToken —
|
See also
| moveToTop | () | method |
public function moveToTop(graphic:Graphic):voidMoves a specific graphic to the top of the stack.
Parameters
graphic:Graphic — The graphic to move.
|
| remove | () | method |
public function remove(graphic:Graphic):voidRemoves the specific graphic.
Parameters
graphic:Graphic — The graphic to remove.
|
See also
| graphicAdd | Event |
com.esri.ags.events.GraphicEventcom.esri.ags.events.GraphicEvent.GRAPHIC_ADDFires when a graphic is added to the GraphicsLayer.
Defines the value of thetype property of a graphicAdd event object.
| graphicRemove | Event |
com.esri.ags.events.GraphicEventcom.esri.ags.events.GraphicEvent.GRAPHIC_REMOVEFires when a graphic is removed from the GraphicsLayer.
Defines the value of thetype property of a graphicRemove event object.
| graphicsClear | Event |
com.esri.ags.events.GraphicsLayerEventcom.esri.ags.events.GraphicsLayerEvent.GRAPHICS_CLEARFires when all graphics in the GraphicsLayer are cleared.
Defines the value of thetype property of a graphicsClear event object.
<esri:Map>
<esri:ArcGISTiledMapServiceLayer
url="http://server.arcgisonline.com/ArcGIS/rest/services/World_Physical_Map/MapServer" />
<esri:GraphicsLayer>
<esri:Graphic>
<esri:geometry>
<esri:MapPoint x="1447000" y="7477000" spatialReference="{new SpatialReference(102100)}"/>
</esri:geometry>
</esri:Graphic>
</esri:Map>