[TIMOB-1122] Geolocation listener fires repeatedly
GitHub Issue | n/a |
---|---|
Type | Bug |
Priority | Low |
Status | Closed |
Resolution | Invalid |
Resolution Date | 2011-05-04T15:49:17.000+0000 |
Affected Version/s | n/a |
Fix Version/s | Release 1.7.0, Sprint 2011-18 |
Components | iOS |
Labels | geolocation, ios |
Reporter | Curtis Olson |
Assignee | Stephen Tramer |
Created | 2011-04-15T02:44:34.000+0000 |
Updated | 2017-03-02T19:31:41.000+0000 |
Description
Titanium.Geolocation.addEventListener gets fired 50-75/sec on app startup with no location changes. My understanding was that this was only supposed to fire when the location changed. On the iphone simulator, I'm seeing this fire every 3 seconds. On the devices its many, many times a second. It slows down the app start-up and causes time-outs.
http://pastie.org/994622">http://pastie.org/994622
In the console log, you can see the first location request and then the following 187 are lines are the location listenter.
Here is the code from app.js that requests location. It is very close to the KitchenSink code.
I'm seeing the same behavior. It doesn't make any sense.
I'm see this problem as well.
When I test the code in the KitchenSink, I can't get the position to update based on a position change (according to the distance filter). Only the initial position is acquired, and no subsequent positions are acquired. The distance filter seems inoperable.
The only way I've managed to get working GPS functionality is to call
getCurrentPosition
on the location event like this:So I'm basically getting the initial position over and over again using the
location
event. It feels wrong, but it's the only thing I've been able to figure out.Having the same problem with the kitchen sink code, it only seems to update the first time then hangs. Although, after opening the google maps app and allowing the GPS to sync and pulse, closing google maps, then opening the kitchen sink app again it seems to work properly and location updates flow in and regular intervals. Any ideas!?
We are seeing the same problem that norm is seeing.
Later location updates seem to fire up even when the location doesnt change. Kitchensink example doesnt work as coded. Let us know if you need more info.
Looks like this is a pressing issue.
"Fixed" by 89ba1a4. Issue was that we had a feature which covers this issue, but it was not documented.
@Stephen Tramer, Where can we find the documentation?
In the apidocs, which are not published until release. You can always view the specific changes made to the documentation formatting files: https://github.com/appcelerator/titanium_mobile/commit/89ba1a4b9f450909cc58c67cdf0d8669f388d9d7#diff-0
Closed as invalid.