1. #1
    Sencha User
    Join Date
    Mar 2012
    Posts
    15
    Answers
    1
    Vote Rating
    0
    primski is on a distinguished road

      0  

    Default Unanswered: proper geolocation

    Unanswered: proper geolocation


    Should "Ext.util.Geolocation" initialize GPS device on Android phones?

    "applyProvider" function does return navigator.geolocation object in some cases, which takes advantage of Phonegap API, correct?

    How do I make it use it? It just doens't init my GPS device...

    Code:
    me.geo = Ext.create('Ext.util.Geolocation', {
        //provider: navigator.geolocation,
        allowHighAccuracy: true,
        //enableHighAccuracy: true,
        autoUpdate: true,
        listeners: {
          locationupdate: function(geo) {
             console.log(geo);
          },
          locationerror: function(geo, bTimeout, bPermissionDenied, bLocationUnavailable, message) {
             console.log('error');
          }
       }
    });
    //me.geo.setProvider(me.geo.applyProvider());
    //me.geo.applyProvider()
    me.geo.updateLocation();
    And with using Ext.device.Geolocation.... the sencha-all.js build says there is no device module....


    ST2 2.0.0 commercial licence
    Last edited by primski; 5 Apr 2012 at 2:25 AM. Reason: ST2 version

  2. #2
    Sencha - Senior Forum Manager mitchellsimoens's Avatar
    Join Date
    Mar 2007
    Location
    Gainesville, FL
    Posts
    37,219
    Answers
    3521
    Vote Rating
    859
    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 geolocation but if you are using a native wrapper then you need to use Ext.device.Geolocation. You will need to require the Ext.device namespace files.
    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.

Thread Participants: 1