1. #1
    Sencha User
    Join Date
    Jun 2011
    Posts
    52
    Vote Rating
    0
    won.rhee is on a distinguished road

      0  

    Default 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 :

    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(); },
    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.

    It is ok to use Ext.util.Geolcation with PhoneGap for getting gps locations, right?
    Any thoughts on this???

  2. #2
    Sencha - Senior Forum Manager mitchellsimoens's Avatar
    Join Date
    Mar 2007
    Location
    Gainesville, FL
    Posts
    37,047
    Vote Rating
    850
    mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute

      0  

    Default


    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
    ________________
    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 in print!

    When posting code, please use BBCode's CODE tags.

  3. #3
    Sencha User
    Join Date
    Jun 2011
    Posts
    52
    Vote Rating
    0
    won.rhee is on a distinguished road

      0  

    Default


    Quote Originally Posted by mitchellsimoens View Post
    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.
    I've used navigator.geolocation.stop()

    This will stop gps locations calls when used with phonegap.

    http://groups.google.com/group/phone...2c90ed9a6d9dfb

Thread Participants: 1

Tags for this Thread