AnsweredAssumed Answered

Polygon insertPoint with setTimeout

Question asked by shadc on Feb 1, 2019
Latest reply on Feb 1, 2019 by rscheitlin

Trying to insert a point into a polygon graphic on a time delay using setTimeout.  The code works as expected if I insert the point immediately when the page loads, but if I wait three seconds nothing draws, but the data has been updated.  This JSFiddle example has a function called start.  When I call the function directly it works, but when I call it after a 3 seconds delay using setTimeout it does not update the graphic.  Is this a bug or am I missing something?

 

Also, if I change the time to 700 milliseconds it works... 900 it does not.  In between it works randomly. 

 

 

function start() {
    polylineGraphic.geometry.insertPoint(0, 0, [-112.3, 53.68]);
}

 

start(); // Works
//setTimeout(function () { start(); }, 3000); // Does not work.

 

 

 

Outcomes