Select to view content in your preferred language

FlareClusterer : how to get the graphic clicked

2025
12
01-30-2011 11:23 PM
chitrasrivastava
Emerging Contributor
Hi,

I have implemented FlareClusterer and I have a requirement in my project that if i click on the individual flare I should be able to find out which object has been clicked.

graphicsLayer.FindGraphicsInHostCoordinates(transformScreenPnt) is not giving me the correct object which has been selected.
From the given collection of objects in flare cluster symbol , i want to identify which one is clicked.


Regards,
Chitra
0 Kudos
12 Replies
KyleBunting
Emerging Contributor
cphill11,
No, I am able to get MapTips for each "flare" without any coding.  The problem I was having and what my code addresses is a way to handle the click event for an individual "flare" within a cluster.  I needed a way to figure out which "flare" within a cluster was clicked, and currently, the ArcGIS Silverlight API does not provide any means with which to accomplish this.  None of the Graphic object mouse events (other then MouseLeave) work for objects contained within a GraphicsClusterer, so a workaround was necessary.  The Map_MouseLeftButtonDown event suggested by ESRI engineers earlier in this thread only results in a collection of Graphics at the point clicked being returned, but it did not provide a way to know which "flare" was clicked.  What I did was create a custom FlareClusterer so I could add attributes the the Graphics in the GraphicCollection that will allow me to match the "flare" clicked with its underlying Graphic.

Hopefully this clarifies what problem I was addressing.

Regards,
Kyle
0 Kudos
Charles__Jamie_Phillips
Occasional Contributor
Thanks for the info.  Glad you got it solved.
0 Kudos
komalagarwal
Deactivated User
Hi Kyle

Thanks for your code. It really saved a lot of time 🙂
However i have two more queries, Please help me with the same:

1. As custom Flareclusterer overrides the base clusterer therefore it also overrides its symbology. Is there any way I can define my symbols for the cluster when I am assigning the element Index.

2. My Map Tip content is a datagrid, when i bind the grid in infoWindow, and try to increase the size of info window it behaves in a weired manner and only 50% of grid is displayed distorting the size of Infowindow.

Please help.
0 Kudos