Results 1 to 8 of 8

Thread: Ext.device.Geolocation

  1. #1
    Touch Premium Member
    Join Date
    Feb 2009
    Location
    Firenze, Italia
    Posts
    165
    Answers
    1
    Vote Rating
    0
      0  

    Exclamation Unanswered: Ext.device.Geolocation

    Hi, with Ext.device.Geolocation.getCurrentPosition(), if failure, it's possible to know the reason like Ext.util.Geolocation (with bTimeout, bPermissionDenied, bLocationUnavailable and message)?

    Thanks
    Stefano

  2. #2
    Touch Premium Member
    Join Date
    Feb 2009
    Location
    Firenze, Italia
    Posts
    165
    Answers
    1
    Vote Rating
    0
      0  

    Default

    Please, it's important!

  3. #3
    Touch Premium Member
    Join Date
    Feb 2009
    Location
    Firenze, Italia
    Posts
    165
    Answers
    1
    Vote Rating
    0
      0  

    Default

    Anyone? How do I know if the application has not been authorized to use the GPS?
    thanks
    stefano

  4. #4
    Sencha - Sr Software Engineer mitchellsimoens's Avatar
    Join Date
    Mar 2007
    Location
    Gainesville, FL
    Posts
    39,326
    Answers
    3884
    Vote Rating
    1297
      0  

    Default

    Have you looked at the Docs?

    Code:
    Ext.device.Geolocation.getCurrentPosition({
        success: function(position) {
            console.log(position.coords);
        },
        failure: function() {
            console.log('something went wrong!');
        }
    });
    Mitchell Simoens @LikelyMitch
    Sencha Inc, Senior Software Engineer
    ________________
    Learn BBCode and use it!

    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.

  5. #5
    Touch Premium Member
    Join Date
    Feb 2009
    Location
    Firenze, Italia
    Posts
    165
    Answers
    1
    Vote Rating
    0
      0  

    Default

    Hi mitchells, sure, I've read the docs.
    The failure callback don't retur any error object... Ineed to know if the user has disabled localization...

    thanks
    stefano

  6. #6
    Touch Premium Member hotdp's Avatar
    Join Date
    Nov 2010
    Location
    Denmark
    Posts
    604
    Answers
    8
    Vote Rating
    14
      0  

    Default

    Quote Originally Posted by stefx View Post
    Hi mitchells, sure, I've read the docs.
    The failure callback don't retur any error object... Ineed to know if the user has disabled localization...

    thanks
    stefano
    You can do like this:
    Code:
    var geo = Ext.create('Ext.util.Geolocation', {    autoUpdate: false,
        listeners: {
            locationupdate: function(geo) {      
                alert('YAY!');                  
                var myPosition = {
                    lat : geo.getLatitude(),
                    lng : geo.getLongitude()              
                };
    
    
            },
            locationerror: function(geo, bTimeout, bPermissionDenied, bLocationUnavailable, message) {
                if(bTimeout){
                    alert('Timeout occurred.');
                } else {
                    alert('Error occurred.');
                }
            }
        }
    });
    geo.updateLocation();

  7. #7
    Touch Premium Member
    Join Date
    Feb 2009
    Location
    Firenze, Italia
    Posts
    165
    Answers
    1
    Vote Rating
    0
      0  

    Default

    I need to use Ext.device.Geolocation. otherwise I get two GPS request...
    thanks
    stefano

  8. #8
    Touch Premium Member hotdp's Avatar
    Join Date
    Nov 2010
    Location
    Denmark
    Posts
    604
    Answers
    8
    Vote Rating
    14
      0  

    Default

    Quote Originally Posted by stefx View Post
    I need to use Ext.device.Geolocation. otherwise I get two GPS request...
    thanks
    stefano
    Because you already use the other one or why two request?

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •