1. #1
    Touch Premium Member
    Join Date
    Feb 2009
    Location
    Firenze, Italia
    Posts
    162
    Vote Rating
    0
    Answers
    1
    stefx is on a distinguished road

      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
    162
    Vote Rating
    0
    Answers
    1
    stefx is on a distinguished road

      0  

    Default

    Please, it's important!

  3. #3
    Touch Premium Member
    Join Date
    Feb 2009
    Location
    Firenze, Italia
    Posts
    162
    Vote Rating
    0
    Answers
    1
    stefx is on a distinguished road

      0  

    Default

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

  4. #4
    Sencha - Senior Software Engineer mitchellsimoens's Avatar
    Join Date
    Mar 2007
    Location
    Gainesville, FL
    Posts
    38,232
    Vote Rating
    1057
    Answers
    3647
    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

    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 @SenchaMitch
    Sencha Inc, Senior Software Engineer
    ________________
    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
    162
    Vote Rating
    0
    Answers
    1
    stefx is on a distinguished road

      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
    Vote Rating
    14
    Answers
    8
    hotdp will become famous soon enough

      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
    162
    Vote Rating
    0
    Answers
    1
    stefx is on a distinguished road

      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
    Vote Rating
    14
    Answers
    8
    hotdp will become famous soon enough

      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?

Thread Participants: 2

Tags for this Thread