[RESOLVED]How to override the onClick event on graphic which has attributes to..

795
1
06-07-2012 06:50 PM
MichalGasparovic
New Contributor III
Hi I've noticed that once the graphic has some attributes, which is common for graphics from queries or with custom attributes, then it's impossible to draw another graphic over the existing one, as when you click on the graphic, it shows the info window instead of proceeding with the map 'onclick' event.

Here is the example :
- I have a measure tools that measure the area and after the polygonal graphic is drawn I set it some attributes
- I want to be able to draw another polygonal graphic, let's say within the one created in the step above. But because the graphic has atributes (and template), instead if drawing another vertex it's showing the infoWindow.

If the graphic has no attributes (and no infoTemplate) the drawing works normally.

Any ideas on how to prevent the InfoWindow to show up and proceed with the map "onClick" event? Or eventually, how to pass the event of the click on the graphic layer onto the map elemtns itself??

Thank you

here is the sample in js fiddle:  JS FIDDLE SAMPLE
1) create a polygon
2) try to create second polygon from within the first one
0 Kudos
1 Reply
MichalGasparovic
New Contributor III
ok.. I've resolved it.. quite simple really
dojo.connect(map.graphics, "onClick", function(a){  
   map.infoWindow.hide();
   map.onClick(a);
});
0 Kudos