05-21-2013 05:45 PM - edited 05-21-2013 05:46 PM
Haven't really read through all of this, but are you getting threading issues?
Read up about how the browsers manage threads. Because only a single thread is used for UI, anything that is interval based has to wait until it receives control.
That would explain why navigator.geolocation.watchPosition works ok - because the underlying process is managing threads, whereas navigator.geolocation.getCurrentPosition has to wait until the UI thread has time to process so requests stack up if the thread is busy doing something else, and then are executed all at once (in this case when the thread is no longer suspended).
05-21-2013 06:55 PM - edited 05-21-2013 06:57 PM
For Cascades, this explains how location works
05-24-2013 02:41 AM
@br14: thanks! I had no idea about this! It kinda sucks, this is the second limitation I'm facing with WebWorks - looks like it's really NOT as similar to Native as BlackBerry is saying!
Anyways, I removed the option to let the user set the interval and I'm only letting the user choose the location High Accuracy! The watcher keeps poling locations like crazy (almost once evey 3-4 seconds sometimes - even though I'm not moving!) but it looks like I got no other choice!
I'm going to keep this thread open just to see what other insight poeple have on this or if someone manages to find a workaround to poling on interval!
05-24-2013 09:37 AM
Not really a WebWorks limitation - more an ECMA (?) standard. Hence the invention of "Workers". You could check out workers, but I don't think the navigator object (and therefore geolocation services) is available to workers.