Select to view content in your preferred language

Updating graphic layers

1386
1
02-22-2017 10:01 AM
MichaelGreene2
Deactivated User

This is a general question about the best methods to draw features that update within a graphics layer.  For instance, I am interested in drawing a line of sight line that changes direction through time as I move a Q-slider. Should I have a pointer to a graphics overlay that I create a new instance of each time I want to redraw the line?  Or is there a more elegant method for redrawing on a map?

0 Kudos
1 Reply
LucasDanzinger
Esri Frequent Contributor

It would be best to have 1 graphics layer, and to have a renderer set on it defining how all the graphics in it should look. Then, have 1 graphic instance, where you continually just re-set the geometry on it. Create a new geometry each time the slider value changes and re-set it to the graphic, and it should update the graphic.