var lastSelectedGraphic; function init() { /** ** Do your init work here... **/ map.graphics.enableMouseEvents(); dojo.connect(map.graphics, "onClick", function(evt) { lastSelectedGraphic = evt.graphic; // You can do more work with the graphic here, but it is also stored for access anytime time later. }); } init();
var lastSelectedGraphic; function init() { /** ** Do your init work here... **/ map.graphics.enableMouseEvents(); dojo.connect(map.graphics, "onClick", function(evt) { lastSelectedGraphic = evt.graphic; // You can do more work with the graphic here, but it is also stored for access anytime time later. }); } init();
From there you can get what you need, I think.