Is there a way to code which graphic shows up on top when multiple have the same lat/long using the javascript api?

07-13-2020 10:45 AM
New Contributor II

I'm using the javascript api to create a feature layer with client side graphics. There are many instances where multiple graphics have the exact same latitude and longitude. I want to be able to set which graphic is displayed when this scenario occurs. Also, when this happens the popup has the arrows to shuffle through the features, however, the graphic that was on top initially continues to display when cycling through the features. It would be ideal if it showed the different graphics as the user cycles through them on the popup.

I'm adding the graphics to the feature using a custom renderer with the 'unique-value' type.

Please let me know if more information is needed to assist.

Thanks in advance for any help.

0 Kudos
1 Reply
MVP Esteemed Contributor

One of the best ways I can think of is to add a GraphicsLayer to the view and watch to the popups selectedFeature property and clone that feature/graphic and add it to the GL.