Are phonegap and parse call asynchronous
I have some strange behavior on my app due to what I think are asynchronous services that I'm not handling properly:
I use a location service (via PhoneGap) that should return the device's lat/lng
I have a parse REST API call that should return a collection of information that should be plotted as markers on a Google map.
OK - when all conditions are just fine (e.g. reception, parse performance, etc) - then all seems ok - that is, I enter the mapping screen and everything is plotted correctly in the correct location (i.e. location worked quickly and smoothly and parse returned quickly and smoothly).
Sometimes, the map is plotted in the wrong location (previous location instead of current location) - which tells me that the phone's current location might be an asynchronous call that I don't always catch without a callback.
Also - sometimes I don't get any markers plotted which tells me that the return from parse was also missed without a callback.
Do both of these require a callback? Example code for these? How would that work? I was relying on the "Success" event in Tiggzi - does that guarrentee that data was returned or that the call (potentially asynch) was return, but not yet finished.
Details?