Hi all,
I am building an ExB custom widget that listens for the view updating event. I have set up the listener using reactiveUtils as below;
const viewUpdating = reactiveUtils.when(() => !jmvRefAMISTracking.current.view.updating,() =>{
console.log('view has finished updating, get assets in current map view.')
getAssetsInCurrentView()
//onShowErrorRings()
})
The function getAssetsInCurrentView() updates the state of grid that is displayed on the widget. In addition to updating the grid I would like to also add a few features to a graphics layer. Typically the number of fews added will be <5 with very simple geometry.
The code I have to add the graphics is shown below
locationErrorBuffers.current.graphics.add(new Graphic ({
geometry: error_circle,
symbol: sfs
}))
The line above is causing an infinite loop for some reason and my browser becomes unresponsive.
Is the a limitations on the code that I can execute after my view has finished updating? If I comment out the line that adds graphics everything works fine as I expect. Any pointers will be much appreciated.
Regards,