Hi everyone,
My application currently has an interesting problem. This problem is with OpenMap but could probably be applied to any 3rd party library.
In this particular example, our code needs to create our OpenMap tool and load its layers (in the background) and take a screenshot of a particular point of interest.
However, the problem is that the OpenMap library creates its own thread(s) to load these layers, thus returning to our code to take a screenshot immediately and most times the screenshot is empty or incomplete.
The pseudo-code of our application is like this:
check database for layers
load layers using OpenMap
take screenshot of map at point of interest
I've assumed that some sort of thread management was in order, but how can this be done when the library is using its own thread(s) that we have no access to? Also, OpenMap has no returns or flags to indicate that these thread are finished (that I've seen).
Any suggestions?
Thank you