GraphicsLayer onClick event

1565
2
Jump to solution
11-20-2012 10:39 AM
GregKnight
Occasional Contributor
Hi all,

I am having a hard time capturing the 'onClick' event of a GraphicsLayer. 

I am capturing the 'onMouseOver' and 'onMouseOut' events for this layer as follows:

dojo.connect( queryGraphicsLayer, "onMouseOver", queryLayer.showToolTip ); dojo.connect( queryGraphicsLayer, "onMouseOut", queryLayer.hideToolTip );


With this, I am able to swap in/out a highlight symbol as the mouse moves over the graphics.  All good here. 

I also need to capture the 'onClick' event, so I can go do some other work when the user clicks on the graphic.

I have tried all of the following approaches with no success.


dojo.connect( map.graphics, "onClick", queryLayer.graphics_OnClickHandler );  dojo.connect( queryGraphicsLayer, "onClick", queryLayer.graphics_OnClickHandler );  dojo.connect( graphic, "onClick", queryLayer.graphics_OnClickHandler ); queryGraphicsLayer.add( graphic );


Why is the 'onClick' event being so elusive? 

Suggestions appreciated.  Thank you much.

Greg
0 Kudos
1 Solution

Accepted Solutions
2 Replies
__Rich_
Occasional Contributor III
0 Kudos
GregKnight
Occasional Contributor
I understand what is happening now.

Thank you.
0 Kudos