Phantom, Persistent, Duplicate Graphics in GraphicsLayer

1764
11
Jump to solution
07-20-2017 09:06 AM
TylerWaring
Occasional Contributor II

Greetings, 

 This is definitely strange. I am selecting features from a point, a polyline and a polygon featurelayer by distance from a point. I'm creating a graphics layer for each featuretype and highlighting the graphics in the map. All feature types but the points display properly. The points however, maintain a set of phantom graphics that persist at the zoomscale at which they were created. So when you zoom in, there appear to be a second set of point graphics with the same geometry relationship but at the scale at which the graphics layer was first drawn.

The interesting this is that if I add the graphics to the graphicsLayer and do not refresh programmatically, then when the graphics layer redraws when the zoom scale is changed there is no issue. However, if I redraw the graphics layer programmatically then the issue presents. 

I've dug in a little to try to debug this situation. I created a mouseover event on the graphics in the graphicsLayer but the phantom graphics do not respond. The length of the graphics in the graphics layer does not include the phantom graphics either. 

Has anyone ever seen this? Also, what method does a zoom change call on the graphicsLayer? I had assumed that redraw was called on the graphicsLayer but redraw also causes the issue to present. 

Please see the image that I have included. The 'Phantom Graphics' are outlined in black. I have zoomed in and drawn black lines to the points that these phantom graphics correspond with at the initial scale that graphics layer was drawn at. 

Any information or tips will be greatly appreciated. 


Tyler 

Tags (2)
0 Kudos
11 Replies
Arne_Gelfert
Occasional Contributor III

Just came across this myself... never seen it before. Adding a single polyline graphic to a graphics layer and than zooming in and out creates a cascading series of smaller and/or larger siblings of that graphic. Not sure how else to describe this. I've tried all above suggested fixes. No luck yet. if anyone else has seen this in the last 4 year since the original post, please holler. Using JSAPI 3.31, AGS10.9, WAB2.21.

siblings.png

0 Kudos
Arne_Gelfert
Occasional Contributor III

The only way to overcome this behavior was by adding an event handler for zooming that creates a new graphic from the existing one, clear the layer and then adds the new graphic. It works but hey, it's workaround for unexplainable behavior.

0 Kudos