AnsweredAssumed Answered

GraphicsLayer not redrawing visually while a Graphic is being dragged

Question asked by Nick.Dragunow on Jun 6, 2018
Latest reply on Jun 7, 2018 by odoe

I've implemented a 'route between points' site using the 4.7 JavaScript API. The logic works fine, but I'm having a graphical display issue: when a point is picked up and dragged to a new location it doesn't redraw intermittently, the mouse simply drags an invisible point to the new location, where it reappears. 

 

The 'update' event fires every time the mouse moves, but the graphics layer won't redraw on the screen, even when cloning the graphic, deleting it from the graphics layer, and re-adding it - the usual fix for a graphic not re-drawing upon being edited.

 

Oddly, everything works fine if the user zooms in or out of the map while gripping the point. Things start drawing, and the greyOutAllRouteLines function (which sets the colour of every line on the map to grey, to indicate that with the shifted point they're now out of date) works as advertised. In both cases the remove/clone/re-add method is required, otherwise nothing redraws regardless of map interaction.

 

It feels like the graphics layers are being updated quite happily while the 'update' events are firing, but they aren't being prompted to re-draw until the map is interacted with, at which point they function as expected. 

 

Here's the event handler: 

 

Outcomes