Select to view content in your preferred language

How to tell if a graphic is clustered

437
5
10-16-2024 08:48 AM
JacobCurrier
Emerging Contributor

I'm using feature reduction on a graphic overlay and I'm wondering if there is there a way to tell which graphics in the overlay are being clustered?

0 Kudos
5 Replies
Ting
by Esri Contributor
Esri Contributor

Maybe you can test the type of the graphic, such as if graphic is AggregateGeoElement . Does this work in your situation?

0 Kudos
JacobCurrier
Emerging Contributor

Is there a way to see all of the GeoElements in an overlay? Both Graphic and AggregateGeoElement are subclasses of GeoElement I believe. From what I can tell graphicOverlay.graphics returns the Graphics in the overlay and not the AggregateGeoElements.

0 Kudos
Ting
by Esri Contributor
Esri Contributor

There isn't a way to get all the graphics, including the cluster graphics from an overlay. The clusters are computed on-the-fly, which means they aren't stored in the overlay.

 

Can you share more details and explain why you want to tell which graphic is being clustered? Depending on user interaction, a graphic might be clustered into different clusters. We'd like to know the workflow you want to achieve so that we might provide more information.

0 Kudos
JacobCurrier
Emerging Contributor

For each of the graphics on the map we are showing a custom popover with some information about what's happening at that point. As the user pans/zooms we calculate which graphics are currently in the maps visible area and show the popover above the graphic. The goal is to hide the popover for graphics that are clustered, while keeping it visible for graphics that's aren't in a cluster. 


0 Kudos
Ting
by Esri Contributor
Esri Contributor

Thanks for the clarification. I checked with my colleague and unfortunately, currently there isn't a way to tell if a graphic is clustered or not without identifying it. 😔

If you want that supported in the future, would you log an idea on the ArcGIS Maps SDKs Native Ideas board? Thanks for your question.

0 Kudos