Description
A layer that contains one or more
Graphic features. Each map contains a GraphicsLayer by default, accessible using the
Map.Graphics property. Beginning with v1.4, you can create your own graphics layers and add them to the map. Graphics layers can be reordered within the group of graphics layers. However, the graphics layer in
Map.Graphics is always on top. Also, all graphics layers are always on top of
TiledMapServiceLayers and
DynamicMapServiceLayers.
Class hierarchy
esri.layers.Layer
|_ esri.layers.GraphicsLayer
Constructor
Properties
Methods
Events
Constructor Detail
esri.layers.GraphicsLayer()
Creates a new GraphicsLayer object. (As of v1.4)
esri.layers.GraphicsLayer(options?)
Creates a new GraphicsLayer object with parameters. (As of v1.4)
Parameters:
|
<Object>
options |
Optional |
See options list for parameters.
|
Options:
|
<Boolean>
displayOnPan |
When true, graphics are displayed during panning. When false, the graphics are turned off during pan movement. Setting to false may improve performance in Internet Explorer. The default is true.
|
|
<String>
id |
Id to assign to the layer. If not assigned, esri.Map assigns value.
|
|
<Boolean>
visible |
Initial visibility of the layer. Default is true.
|
Properties Detail
The array of graphics that make up the layer.
Renderer assigned to the GraphicsLayer. (As of v1.4)
Methods Detail
Adds a graphic.
Input Parameters:
|
<Graphic> graphic |
Required |
The graphic to add. |
Clears all graphics.
Return value: none
Disables all mouse events on the graphics layer.
Return value: none
Enables all mouse events on the graphics layer.
Return value: none
Removes a graphic.
Input Parameters:
|
<Graphic> graphic |
Required |
The graphic to remove. |
Sets the renderer for the graphics layer.
Return value: none
Input Parameters:
|
<Renderer> renderer |
Required |
The renderer used for the graphic. |
Events Detail
Fires when a graphic has been clicked.
Arguments:
|
<Object> event
|
The returned object contains screenPoint, mapPoint, and Graphic.
|
Fires when a graphic is added to the GraphicsLayer.
Arguments:
|
<Graphic> graphic
|
The added graphic.
|
Fires when a graphic is removed from the GraphicsLayer.
Arguments:
|
<Graphic> graphic
|
The removed graphic.
|
Fires when all graphics in the GraphicsLayer are cleared.
Fires when a mouse button is pressed down and the mouse cursor is on a graphic.
Arguments:
|
<Object> event
|
The returned object contains screenPoint, mapPoint, and Graphic.
|
Fires while the mouse is being dragged until the mouse button is released.
Arguments:
|
<Object> event
|
The result can be any JavaScript MouseEvent, or the x and y coordinates of screenPoint or mapPoint.
|
Fires as the mouse moves through a graphic on the GraphicsLayer.
Arguments:
|
<Object> event
|
The returned object contains screenPoint, mapPoint, and Graphic.
|
Fires as the mouse exits a graphic on the GraphicsLayer.
Arguments:
|
<Object> event
|
The returned object contains screenPoint, mapPoint, and Graphic.
|
Fires when the mouse first enters into a graphic on the GraphicsLayer.
Arguments:
|
<Object> event
|
The returned object contains screenPoint, mapPoint, and Graphic.
|
Fires when a mouse button is released and the mouse cursor is on a graphic.
Arguments:
|
<Object> event
|
The returned object contains screenPoint, mapPoint, and Graphic.
|