I am using toScreen method of map to convert the map points into screen points, which are then used to calculate the extents of a graphic drawn in the graphic layer in screen points. These screen points changes every time we move the map or zoom in/out. I have to recalculate the screen points again every time map is moved to keep the extents updated.
My goal is to keep track of map extents in screen points of each graphic drawn. But the recalculation takes a lot of time if the number of graphics are high. So I am trying to make use of web workers to do the calculation but can't use the same toScreen method in web worker.
Can we create our own toScreen method that can be added in web worker to do the calculation in seperate thread? I just need to understand how the screen points are calculated in map.