-
16 Dec 2011 5:05 PM #1
PhoneGap(1.2.0)+GoogleMap+Ext.util.GeoLocation
PhoneGap(1.2.0)+GoogleMap+Ext.util.GeoLocation
This is driving me crazy... Same code works just fine on web browser but does not disconnect gps location calls when used with PhoneGap.
So basic controller code :
So given above config, current location call should timeout at 5 seconds. It never does. I always see that GPS mark on top-right of iPhone. Never goes away, iPhone becomes very sluggish.Code:index: function(options) { if(!this.listPanel){ this.listPanel = this.render({ xtype:'LocationsListView' }); } this.application.viewport.setActiveItem(this.listPanel, {type:'fade'}); this.geo = new Ext.util.GeoLocation({ //tried all sorts of stuff in here autoUpdate: false,allowHighAccuracy: true,maximumAge: 1000, timeout: 5000 }); this.geo.on('locationupdate', this.onGeoUpdate, this); this.geo.on('locationerror', this.onGeoFail, this); this.geo.updateLocation(); },
It is ok to use Ext.util.Geolcation with PhoneGap for getting gps locations, right?
Any thoughts on this???
-
17 Dec 2011 7:46 AM #2Sencha - Senior Forum Manager
- Join Date
- Mar 2007
- Location
- St. Louis, MO
- Posts
- 33,678
- Vote Rating
- 435
Ext.util.GeoLocation uses the HTML5 spec for getting geolocation. If PhoneGap doesn't like this, you may have to see if they have a plugin or something to use.
Mitchell Simoens @SenchaMitch
Sencha Inc, Senior Forum Manager
________________
http://www.JSONPLint.com - Source to lint your JSONP!
Check out my GitHub, lots of nice things for Ext JS 4 and Sencha Touch 2
https://github.com/mitchellsimoens
Think my support is good? Get more personalized support via a support subscription. https://www.sencha.com/store/
Need more help with your app? Hire Sencha Services services@sencha.com
Want to learn Sencha Touch 2? Check out Sencha Touch in Action that is almost in print!
When posting code, please use BBCode's CODE tags.
-
20 Dec 2011 11:17 AM #3
I've used navigator.geolocation.stop()
This will stop gps locations calls when used with phonegap.
http://groups.google.com/group/phone...2c90ed9a6d9dfb


Reply With Quote